|
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 8916 users |
Added on |
4/3/2013 |
Views |
66971 |
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 |
|
How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques that make it easier for people to use a Web site?
|
View Answer
|
|
How to read and write a file using javascript?
|
View Answer
|
|
How do we get JavaScript onto a web page?
|
View Answer
|
|
What’s relationship between JavaScript and ECMAScript?
|
View Answer
|
|
How do you submit a form using Javascript?
|
View Answer
|
|
What does undefined value mean in javascript?
|
View Answer
|
|
What does javascript null mean?
|
View Answer
|
|
Name the numeric constants representing max,min values
|
View Answer
|
|
How to comment javascript code?
|
View Answer
|
|
How to hide javascript code from old browsers that dont run it?
|
View Answer
|
|
Can javascript code be broken in different lines?
|
View Answer
|
|
What is a prompt box?
|
View Answer
|
|
What is the difference between an alert box and a confirmation box?
|
View Answer
|
|
How to access an external javascript file that is stored externally and not embedded?
|
View Answer
|
|
How to embed javascript in a web page?
|
View Answer
|
|
Are Java and JavaScript the Same?
|
View Answer
|
|
Is a javascript script faster than an ASP script?
|
View Answer
|
|
What does the "Access is Denied" IE error mean?
|
View Answer
|
|
How to set a HTML document's background color?
|
View Answer
|
|
What can javascript programs do?
|
View Answer
|