JavaScript中容易忽視的問題

1.最大數爲2^53,+1仍是2^53javascript

2.String('A')==='A';new String('A')!=='A'java

3.小數進行運算有精度通常不能這麼用小數比較,能夠擴大精度至整數數組

4.typeof null 爲"object",null instanceof Object 爲falseapp

5.數組.filter時undefined不會觸發prototype

6.-9 % 2 = -1;後臺語言會返回1code

7.parseInt(A,B)  ;A爲B進制的數,B爲進制,結果返回10進制的數,B不合法就默認爲10或者NaN。ip

8.Array.isArray( Array.prototype ) = trueelement

9.var a = [0]; if (a) {console.log(a == true);}get

10. map is only invoked for elements of the Array which have been initialized.it

11. in javascript variables are tied to the arguments object so changing the variables changes arguments and changing arguments changes the local variables even when they are not in the same scope.

12.var a = 111111111111111110000, b = 1111; a + b;

13.https://javascript-puzzlers.herokuapp.com/

14.Number.MIN_VALUE == 5e-324

15.2 == [[[2]]]

16.3..toString() = "3"

17.name is a read only property

18.Date(0) 當前時間,new Date(0);1970

19.var min = Math.min(), max = Math.max() min > max  Infinity > -Infinity

相關文章
相關標籤/搜索