0
How can I make this add properly?
https://code.sololearn.com/WwKbqflImFpG/?ref=app The last step seems to combine the 2 numbers as if they were strings. How can I fix this?
4 Answers
+ 5
I wouldn't say it's written in it's best form but for a simple fix, just include the final product in parentheses, so that the addition occurs prior to the implicit conversion to string through string concatenation.
divthree.innerText = dividednum + " + " + dividednum + " = " + dividednum + " = " + (dividednum + dividednum);
+ 3
on line 12 you were adding strings with number. The '+' will change the number to string to join and return the result.
Put the numbers & add operation in parenthesis so it will do addition
divthree.innerText = dividednum + " + " + dividednum + " = " + dividednum + " = " + (dividednum + dividednum);
+ 1
Hi Daniel Cooper,
You did not set Numbers fuction for the prompt. So i added some scriptđ
Take a look at the code and I hope it will help you đ
https://code.sololearn.com/WlDlgbGSe4D1/?ref=app
https://code.sololearn.com/W63XrDw7xTHB/?ref=app
0
Hatsy Rei Lol. Tbh I'm new at coding and actually didn't know if createElement worked more than once so I just added it each time xD
But let me me how I can write it better please. I want to improve my skill.