1.

Which method is not used for converting variables to number?(a) parseInt()(b) Number()(c) parseFloat()(d) valueOf()I had been asked this question by my school principal while I was bunking the class.This intriguing question originated from Essential JavaScript and jQuery topic in portion HTML Tables, Javascript & Jquery Basics of HTML

Answer»

Correct answer is (d) VALUEOF()

The explanation is: There are MAINLY three methods with the help of those we can convert variables to numbers. The methods are the parseFloat() method, the Number() method, the parseInt() method. These are GLOBAL JAVASCRIPT methods. valueOf() method return number as a number only.



Discussion

No Comment Found

Related InterviewSolutions