문제

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