Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Calculator app. Grid, positioning and for js I used setProperty.

Bernardus 1,115

@BernardusPH

Desktop design screenshot for the Calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

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

turtlecrab 550

@turtlecrab

Posted

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 helpful

1

Bernardus 1,115

@BernardusPH

Posted

@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 GitHub
Discord logo

Join 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