Interview Questions

1. What does the isNaN() function?

The isNan() function returns true if the variable value is not a number. 

For example:

function number(num) {  

  if (isNaN(num)) {  

    return "Not a Number";  

  }  

  return "Number";  

}  

console.log(number('1000F'));  

// expected output: "Not a Number"  

  

console.log(number('1000'));  

// expected output: "Number"


By Md Riyazuddin 2 0
Is this helpful? Yes No

Submit an interview question

Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.

Get Started

Comments

Leave a Comment


Check out more interview questions

Based on your skills

MS SQL Server

6633367 1720 1492 859

Angular

203817 92 71 46

Wordpress

171378 72 64 36