1. 在逻辑判断语句中常用到的操作符是算术操作符、逻辑操作符、比较操作符,所以必须了解它们的precedents—— 最高的是 比较操作符 (<=, < , >=, >, ==, !=) 其次是 逻辑操作符 (&&, ||, !) 其中&&优先于|| 最后是 算术操作符(+, -, *, /, %) 可以这么认为:(4<2)&&(3==4)这样的形式是非常常见的,所以就令比较操作符的优先级高于逻辑操作符, 就可以直接写成 4<2&&3==4。 2. Layers: operators(constants&variables)&operants expressions statements (with ; ) functions 3. JavaScript comes with a fully-automatically bit-recycling system. 4. "You should imagine variables as tentacles, rather than boxes. They do not contain values, they grasp them ― two variables can refer to the same value. Only the values that the program still has a hold on can be accessed by it." 某种意义上讲JS中的变量名更像是指针? 那c语言中的变量呢? 5. 可以形成side effect的statements或者functions才是有用的 6. 在JS中,函数是wrapped在value里面的 7. alert("...") confirm("...?") 注意:confirm本身是用来生成询问窗口的,如果使用alert(confirm("...?")),将会由alert函数产生一个新的窗口显示true of false prompt("...","...") 注意:第二个参数可以省略 prompt("...") 8. Converting Function: Number

评论