Skip to content

Commit

Permalink
Update isNan() to typeof (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
ragul1697 authored Jul 15, 2024
1 parent e5637b1 commit 550f65b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/introduction-to-js-1/tasks/math/math2.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
const para1 = document.createElement('p');
para1.textContent = `Your finalResult is ${ finalResult }`;
const para2 = document.createElement('p');
const finalNumberCheck = isNaN(finalNumber) === false ? 'finalNumber is a number type. Well done!' : `Ooops! finalNumber is not a number.`;
const finalNumberCheck = typeof finalNumber === 'number' ? 'finalNumber is a number type. Well done!' : `Ooops! finalNumber is not a number.`;
para2.textContent = finalNumberCheck;

section.appendChild(para1);
Expand Down

0 comments on commit 550f65b

Please sign in to comment.