+
is an operator, it's not a function. typeof +
is therefore a syntax error.
Why typeof + is not "function" javascript
-
01-10-2022 - |
Domanda
As in the title, why
typeof +
doesn't give "function"?
Soluzione
Altri suggerimenti
typeof
only returns types of objects (pretty much everything in JS) and primitives.
See the MDN documentation for typeof
.
As rid points out, +
is an operator and not an object or primitive.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow