1

a strict mode in ECMAScript 5 forbids octal syntax. The octal syntax isn't part of ECMAScript 5, but it's supported in all browsers by prefixing the octal number with a zero: 0644 === 420 and "\045" === "%".

In ECMAScript 2015 Octal number is supported by prefixing a number with "0o".

Why is this behavior. Please elaborate ?

  • It can turn potentially misleading code into an easy-to-fix syntax error instead of a runtime error whose bug you run into (and have to track down) later. – CertainPerformance Apr 30 '19 at 06:04

0 Answers0