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
Does javascript have the concept level scope?
List some design patterns in javascript?
What is callback in javascript?
how to run the servlet in tomcat
What are the main functions performed by javascript statements?
What is new keyword in javascript?
What is scope of variable in javascript?
How do you add an element at the beginning of an array?
Is JavaScript case sensitive? Give an example?
What is console.log()?
What are escape characters in javascript?
Explain spread operator in javascript?
What is difference between scripting and programming?
To set all checkboxes to true using javascript?
What are the primitive data types in JavaScript?