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
What is Unobtrusive JavaScript & Why it's Important?
What are the different objects used in javascripts?
Are you concerned that older browsers don't support javascript and thus exclude a set of web users? Individual users?
What does the "Access is Denied" IE error mean?
What is output of “20” + 20? In javascript?
What is the difference between a web-garden and a web-farm?
How do I add javascript to chrome?
What is called variable?
What are the different actions that are performed using javascript?
Explain spread operator in javascript?
Can I learn javascript without html?
How to create an array in javascript?
What is the main difference between Map collections and other collections such as Set.
Why it is not advised to use innerhtml in javascript?
What is the use of debugger keyword in javascript?