What does ânumeric literalâ mean in java script?
Iâm building a calculator with java script and getting the following syntax error as I enter a problem of this type: a * b * c âNo Identifiers allowed directly after numeric literal at Line 50.â In my function, where I solve the mathematical problem, Iâm taking the string of an input field where you have to enter your question, replace âxâ with â*â (and the division symbol with â/â) and simply use eval() to solve it. However, the error shown above occurs if I try to use the html buttons where you insert the characters into the text. When I press â=â on e.g. â5x9x6â the error is thrown. However if I switch to the keyboard and enter â5*9*6â everything works perfectly. Here Is my function: function calc() { res = document.getElementById('x').value; res=res.replace('x', '*'); res=res.replace('Ă·', '/'); (line 50): document.getElementById('x').value=eval(res); Here is my code: https://code.sololearn.com/W4TkgSK7hdX3/?ref=app Can anyone explain me, what Iâm doing wrong? Thanks.