超适用的JavaScript技巧及最佳实践

超实用的JavaScript技巧及最佳实践11.避免使用eval()或Function构造函数 eval()和Function构造函数被称为

超实用的JavaScript技巧及最佳实践

11.避免使用eval()或Function构造函数

eval()和Function构造函数被称为脚本引擎,每次执行它们的时候都必须把源码转换成可执行的代码,这是非常昂过的操作。

?25. – undefined, null, 0, false, NaN, '' (empty string) are all false.

?

?26. – Create a Self-calling Function

?29. – Transform the arguments object into an array

var myArray = [12 , 222 , 1000 , 124 , 98 , 10 ];  myArray.length = 4; // myArray will be equal to [12 , 222 , 1000 , 124].

?

?