Created
August 11, 2016 18:44
-
-
Save a1exlism/00dcfd26d2212e509d2cad28a6745574 to your computer and use it in GitHub Desktop.
Multiple meaning of point in JavaScript
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
/* .的含义 | |
1、表示算术中的小数点(浮点数),如 2.5 | |
2、取对象属性、方法,如 [].push(2) | |
*/ | |
1.toString(); //Error | |
1..toString(); //Works well | |
1 .toString(); //Works well | |
/* | |
From: http://www.cnblogs.com/snandy/p/3169632.html | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment