Hello! I am doing it now - https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Test_your_skills:_Math#Math_2
Stuck in paragraph 4 - “The value of finalNumber
needs to be 10.42
. Go back and update the original calculations you were provided with so that they give this final result. Don’t update the numbers or the operators.”
I don’t understand how to do this and thanks for the help.
My decision is the first three points.
<script>
// Final result should be 10.42
// Add/update your code here
let result = 7 + 13 / 9 + 7;
let result2 = 100 / 2 * 6;
result *= result2;
let finalResult = result.toFixed(2);
let finalNumber = Number(finalResult);
// Don't edit the code below here!
const section = document.querySelector('section');
let para1 = document.createElement('p');
para1.textContent = `Your finalResult is ${ finalResult }`;
let para2 = document.createElement('p');
let finalNumberCheck = typeof finalNumber === 'number' ? 'finalNumber is a number type. Well done!' : `Ooops! finalNumber is of type ${ typeof finalNumber }.`
para2.textContent = finalNumberCheck;
section.appendChild(para1);
section.appendChild(para2);
</script>