20. 严格模式
ECMAScript v3 – 15.3.4.3
If thisArg is null or undefined, the called function is passed the global
object as the this value. Otherwise, the called function is passed
ToObject(thisArg) as the this value.
ECMAScript v5 – 15.3.4.3
Return the result of calling the [[Call]] internal method of func,
providing thisArg as the this value and argListas the list of arguments.
24. 正则表达式的细节
ECMAScript v3 – 7.8.5
A regular expression literal is an input element that is
converted to a RegExp object (section 15.10) when it is
scanned. The object is created before evaluation of the
containing program or function begins. Evaluation of the
literal produces a reference to that object; it does not
create a new object.
ECMAScript v5 – 7.8.5
A regular expression literal is an input element that is
converted to a RegExp object (see 15.10) each time the
literal is evaluated.
40. 新的语法
Array Comprehensions
执行
add(user) for user of database.all(‘user’)
过滤
print(x) for (x of [1, 2, 3]) if (x % 2 === 0)
多维
[x, y] for (x of rows) for (y of columns)
映射
[Math.abs(x) for (x of [1, -1, 2, -3, 4, 9])]
41. 新的语法
模块化
module | export | import
类化
class | extends
访问权限
public | private
private name generator