Octal literals are not available when targeting ECMAScript 5 and higher

左心房为你撑大大i 提交于 2019-12-05 19:10:46

This is because use of octal literals was supported in ES3 and denoted by a starting 0. Since ES5 these have been deprecated as these are ambiguous and can lead to errors. E.g.:

var o = 0123;
console.log(o); // 83 decimal

Fix: change year >= 00 to year >= 0 as pointed out by nnnnnn

Note: ES6 is going to be better support for octal literals in the form of 0o123 : https://github.com/lukehoban/es6features#binary-and-octal-literals

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!