From 550f65b972b140f43507bb408e86ea8e6965f369 Mon Sep 17 00:00:00 2001 From: Ragul <67683723+ragul1697@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:52:56 +0530 Subject: [PATCH] Update isNan() to typeof (#748) --- javascript/introduction-to-js-1/tasks/math/math2.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/introduction-to-js-1/tasks/math/math2.html b/javascript/introduction-to-js-1/tasks/math/math2.html index 493f55654d..922cda09d2 100644 --- a/javascript/introduction-to-js-1/tasks/math/math2.html +++ b/javascript/introduction-to-js-1/tasks/math/math2.html @@ -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);