文章加密

;

2024年7月23日 星期二

[陷阱] console.log(typeof typeof 1); // string

 console.log(typeof typeof 1); // string


This actually returns "string".

This expression is evaluated from right to left.

The first sub-expression evaluated actually is typeof 1 which will return "number".

Only after that the next sub-expression is evaluated which now is typeof "number" which returns "string".

沒有留言:

張貼留言