Last active
February 19, 2016 06:31
-
-
Save huangguozhen/68866b66ed4b17c03557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic data type: | |
Boolean | |
null | |
undefined | |
Number | |
String | |
Symbol | |
Object | |
在包含加法运算符的数字和字符串表达式中,数字值会转化为字符串。 | |
x = 'The answer is ' + 42; // "The answer is 42" | |
在包含其他运算符时,javascript不会把数字转化为字符。 | |
'37' - 7; // 30 | |
字符串转数字 | |
parseInt() 和 parseFloat() | |
数组字面值 | |
若同一行中连续两个逗号,数组中会产生一个没被指定的元素,其初始值是undefined。尾部的逗号会被忽略 | |
下面的值将被计算出false: | |
** false | |
** undefined | |
** null | |
** 0 | |
** NaN | |
** 空字符串("") | |
不要混淆原始的布尔值true和false 与 布尔对象的值true和false | |
对象操作语句 | |
for...in (key) | |
for each...in (value) | |
<h4>作用域和函数堆栈</h4> | |
一个函数可以通过三种方法调用自身 | |
1.通过函数名 | |
2.使用arguments.callee | |
3.使用作用域下的一个变量来指向函数 | |
作用域链,闭包 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment