How do you convert numbers between different bases in
JavaScript?

Answer Posted / venkateswaran

using Number() function we can converts the value of an
object to a number.

Example:

var test1= new Boolean(true);
var test2= new Date();
var test3= new String("999");
document.write(Number(test1)+ "<br />");
document.write(Number(test2)+ "<br />");
document.write(Number(test3)+ "<br />");

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is slug in javascript?

497


What Does JavaScript Void(0) Mean?

524


What is called variable typing in javascript?

520


What are the main features of javascript?

482


How do you change the style/class on any element using javascript?

480






hi i want validations for two drop down lists. when user enter to second list by skipping first list alert box should appear. drop down validation Please choose an item from the drop down menu:

Choose a username:
Choose a username:
please any body help me thanks

1710


Explain window.onload and ondocumentready?

503


What are the different boolean operators in JavaScript?

467


How to loop through array in javascript?

471


How do you create array in javascript?

516


How to create a function in javascript?

485


What is a hash javascript?

517


just for testing

1745


Is not a function error in javascript?

487


Are java and javascript the same?

529