JSFiddle - React, Tailwind, and code Playground
JavaScript
function checkIfNaN(ipNo)
{
if(ipNo && ipNo.trim()!='')
return isNaN(Number(ipNo));
else
return true;
}
function num()
{
var num1 , num2;
while(checkIfNaN(num1))
{
num1 = prompt("please enter your first number");
}
while(checkIfNaN(num2))
{
num2 = prompt("please enter your second number");
}
if(num1>num2) alert("1Big");
else if(num1<num2) alert("2BIG");
else alert("eq");
}
num();