Why eval(010) returns 8? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why eval(010) returns 8?

js eval

18th Nov 2017, 8:53 PM
Atom Ulikhanyan
Atom Ulikhanyan - avatar
2 Answers
+ 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