What will be the output of below Javascript code,if we pass string value in Floor method?

try
{
alert(Math.floor("Rajesh12.90"));
}
catch (ex)
{
alert(ex.message);
}

 Posted by Rajesh_Kumar on 2/17/2014 | Category: JavaScript Interview questions | Views: 2757 | Points: 40
Answer:

Output would be: NAN

Because If we pass any string value in Floor Method,then it will not throw any error but will show NAN means Not A Number as output.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response