|
INTERVIEW QUESTIONS
WEB
JAVA SCRIPT
DETAILS
Question: How do you convert numbers between different bases in JavaScript?
Answer: 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)
|
|
|
Category |
Java Script Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9446 users |
Added on |
9/22/2014 |
Views |
67285 |
Rate it! |
|
|
Question:
How do you convert numbers between different bases in JavaScript?
Answer:
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) Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What are JavaScript Data Types?
|
View Answer
|
|
How do you submit a form using JavaScript?
|
View Answer
|
|
What are decodeURI() and encodeURI() functions in JavaScript?
|
View Answer
|
|
What's Prototypes for JavaScript?
|
View Answer
|
|
How to create a function using function constructor?
|
View Answer
|
|
What does break and continue statements do in JavaScript?
|
View Answer
|
|
What is eval() in JavaScript?
|
View Answer
|
|
How to associate functions with objects using JavaScript?
|
View Answer
|
|
How to create an object using JavaScript?
|
View Answer
|
|
How to shift and unshift using JavaScript?
|
View Answer
|
|
How to make a array as a stack using JavaScript?
|
View Answer
|
|
How to use "join()" to create a string from an array using JavaScript?
|
View Answer
|
|
How to use strings as array indexes using JavaScript?
|
View Answer
|
|
How to delete an array entry using JavaScript?
|
View Answer
|
|
What does the delete operator do?
|
View Answer
|
|
What's the Date object using JavaScript?
|
View Answer
|
|
What's Math Constants and Functions using JavaScript?
|
View Answer
|
|
How to test for bad numbers using JavaScript?
|
View Answer
|
|
How to convert numbers to strings using JavaScript?
|
View Answer
|
|
How to convert a string to a number using JavaScript?
|
View Answer
|