3 ms·
Or you could be obnoxious and use the syntax that made its way into the EcmaScript standard: 10_000
by pluma 9y ago
Or you could be obnoxious and use the syntax that made its way into the EcmaScript standard: 10_000
- majewsky 9y agoNice to see some Perl lineage popping up in JavaScript.
- bakli 9y agoIs that where Ruby took it from?
- mahmud 9y agoNo, they both got it from Common Lisp (ca 1984)
- xenophonf 9y agoIs that a Common Lisp thing or something that predates the ANSI standard? SBCL doesn't like that syntax: * 10_000 debugger invoked on a UNBOUND-VARIABLE: The variable |10_000| is unbound. According to the Common Lisp HyperSpec, "_" is an alphabetic constituent character: http://www.lispworks.com/documentation/HyperSpec/Body/02_ad.htm#possiblesyntaxtypes http://www.lispworks.com/documentation/HyperSpec/Body/02_ad.... http://www.lispworks.com/documentation/HyperSpec/Body/02_adb.htm#constituenttraitsofstdchars http://www.lispworks.com/documentation/HyperSpec/Body/02_adb...
- kazinator 9y agoRather, perhaps, Ada 83.
- pluma 9y agoI think the syntax in JS actually allows putting them at arbitrary points, e.g. 1_00_0 or 10_00 (both being identical to 1000).
- majewsky 9y agoSame as Perl