+ 1
JavaScript eval() function on a number preceded by four "0"s.
Like, eval(000026)= 24. How come? https://code.sololearn.com/WnzE9nnXceG7/?ref=app
5 Respuestas
+ 1
Nor'wester , numbers starting with 0 are considered octal numbers. So when you convert octal to decimal that's the result 🐱
+ 1
Well, there goes my calculator.
+ 1
not necessarily just work around it... Nor'wester that is what we all learn to do... when there are potential risk.
0
It has come to my attention that it may not be wise to use the eval() in Javascript and would discourage it's use...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval