1/3 = = = (1-2/3); False
Floating-point numbers generate errors during operation because the computer cannot accurately represent infinite loop decimals. To compare two floating-point numbers for equality, you can only calculate the absolute value of their difference to see if they are less than a certain threshold:
Math.Abs (1/3-(1-2/3)) <0.00001; True
ES6 new template string ' '
eg
var name = ' Xiao Ming ';
var age = 20;
Alert (' Hello, ${name}, you ${age} year old! ');
The string is immutable, and if you assign a value to an index of a string, there is no error, but there is no effect.
The concat () method does not modify the current array, but instead returns a new array. In fact, the concat () method can receive any element and array, and automatically takes the array apart and adds it all to the new array.
--a blog that was extracted from Liaoxuefeng
JavaScript data types and variables to be aware of