Why eval(010) returns 8? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Why eval(010) returns 8?

js eval

18th Nov 2017, 8:53 PM
Atom Ulikhanyan
Atom Ulikhanyan - avatar
2 Respostas
+ 5
If you start with a leading zero, it's octal.
18th Nov 2017, 9:44 PM
1of3
1of3 - avatar
+ 4
Add 0 infront it becomes an octal object.
19th Nov 2017, 12:42 AM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar