it works out ok, because I get 10.42. but is it the right way to get it?
Hi @batoru1 and welcome to the community
Nice work. This is mostly correct.
To fix the wrong result you should use parentheses instead of setting the result directly:
let result = (7 + 13) / (9 + 7);
let result2 = 100 / (2 * 6);
This also gives the result of “10.42”.
You could also merge the last two lines together:
let finalNumber = Number(finalResult);
Have a nice day,
Michael
1 Like
Thank you Michael! Very clear explanation
1 Like