How do you convert numbers between different bases in
JavaScript?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / heena
Use the parseInt() function, that takes a string as the
first parameter, and the base as a second parameter. So to
convert hexadecimal 3F to decimal, use parseInt ("3F", 16)
Is This Answer Correct ? | 6 Yes | 3 No |
What are the different ways in which we can use the link tag ? Illustrate with an example. Is it possible to link a file with another file on a different file server ? If yes, how ?
What is array explain it?
What is difference between javascript and jscript?
What are the scopes of a variable in javascript?
How you can modify XAML content from JavaScript in Silverlight?
What is argument objects in javascript?
What is the difference between null and undefined?
How would you organize your javascript code?
What is console.log()?
Is array a data type in javascript?
In javascript what is an argument object?
what is the difference between wrappers and primitives es: diff between int i=200 in primitives and integeri = new integer(54)