Frage

As in the title, why

typeof +

doesn't give "function"?

War es hilfreich?

Lösung

+ is an operator, it's not a function. typeof + is therefore a syntax error.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top