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
How to add html elements dynamically with JavaScript?
Why extending array is bad idea?
How to calculate fibonacci numbers in javascript?
Example of using regular expressions for syntax checking in javascript?
What are the valid scopes of a variable in JavaScript?
Why is javascript so hard?
What is the difference between test () and exec () methods?
Who created npm?
Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?
What are the ways of making comments in javascript?
What is null in programming?
How do I open a .js file?
What is a function callback?
Where do I write javascript code?
Why would you use a sticky session?