JavaScript Number isNaN() Method

Home   »   JavaScript Number isNaN() Method

const checkNAN = (value) => {
  if (Number.isNaN(value)) {
    return "Number NaN";
  }
  if (isNaN(value)) {
    return "NaN";
  }
};

console.log(checkNAN("Hello"));
//Output: "NaN"

Leave a Reply

Your email address will not be published. Required fields are marked *