As in the title, why

typeof +

doesn't give "function"?

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top