JavaScript Number Function

JavaScript Number function enables you to convert the JavaScript object to number only if object supports the number format. If JavaScript object passed to the Number function contains any alphabet then it return NaN i.e. Not a Number. If you will try to pass the JavaScript Date object to the Number function then it will return the number of milliseconds since midnight 1 January, 1970 UTC (Universal Coordinated Time).

Try the sample below to learn and practice the code for JavaScript Number function to convert object into number value:

Edit this code and click update to view output
OUTPUT:
  • HIRE EzineASP.Net Developers