Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Created August 11, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a1exlism/00dcfd26d2212e509d2cad28a6745574 to your computer and use it in GitHub Desktop.
Save a1exlism/00dcfd26d2212e509d2cad28a6745574 to your computer and use it in GitHub Desktop.
Multiple meaning of point in JavaScript
/* .的含义
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