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 is the output of below code var car = new Vehicle("Honda", "white", "2010", "UK"); console.log(car); function Vehicle(model, color, year, country) { this.model = model; this.color = color; this.year = year; this.country = country; }
What is asynchronous javascript?
What is client side in javascript?
What is the best ide for javascript development?
How host objects are different from native objects in javascript?
How to remove duplicates from javascript array?
What is the difference between let, const, and var?
What are the problems associated with using javascript, and are there javascript techniques that you discourage?
I need project details about WEB CONTENT FILTERING USING NEURAL NETWORKS and how to explain it....plz help me in this topic.....
What is javascript hoisting?
What is eager initialization in java?
What looping structures are there in JavaScript?