It's late for this answer but still an update from my side. As said by Pointy in strict mode octal constant are not allowed.
'use strict'
if(022 == 22){
console.log("True");
}
console.log("Failed")
throws an exception
{
"message": "Uncaught SyntaxError: Octal literals are not allowed in strict mode.",
"filename": "https://stacksnippets.net/js",
"lineno": 14,
"colno": 4
}
Even if we add the second digit as 8
or 9
still the leading 0
are not allowed in strict mode
'use strict'
if(029 == 29){
console.log("True");
}
console.log("Failed")
It also throws an exception
{
"message": "Uncaught SyntaxError: Decimals with leading zeros are not allowed in strict mode.",
"filename": "https://stacksnippets.net/js",
"lineno": 14,
"colno": 4
}
Also it didn't make any sense because the leading zeros are the same values without leading zeros. But it needs to be take care when receiving the values from other side.