Calculator app. Grid, positioning and for js I used setProperty.
Design comparison
Solution retrospective
Any advice would be great. Sorry about all the setProperties I am still a beginner. I want to ask why does the computer compute 10 when I type 012 or 18 when I type 022?
Community feedback
- @turtlecrabPosted over 2 years ago
hey, it does so because numbers starting with
0
are octal numeric literals in javascript(octal is like hexadecimal numbers but on base 8). You can disable them by putting'use strict'
in the beginning of you js file, and it will throw syntax error instead of parsing them. I think it's better than returning incorrect(by human standards) computations. I hope it did help!Marked as helpful1@BernardusPHPosted over 2 years ago@turtlecrab Thank you, the syntax error is better than having random numbers as answers.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord