|
INTERVIEW QUESTIONS
WEB
JAVA SCRIPT
DETAILS
Question: How can convert the string of any base to integer in JavaScript?
Answer: The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter, and the second parameter is the base of the given string.
In order to convert 4F (of base 16) to integer, the code used will be –
parseInt ("4F", 16); 1 parseInt ("4F", 16); 25. Explain the difference between “==” and “===”?
“==” checks only for equality in value whereas “===” is a stricter equality test and returns false if either the value or the type of the two variables are different.
|
|
|
Category |
Java Script Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6948 users |
Added on |
5/19/2016 |
Views |
69495 |
Rate it! |
|
|
Question:
How can convert the string of any base to integer in JavaScript?
Answer:
The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter, and the second parameter is the base of the given string.
In order to convert 4F (of base 16) to integer, the code used will be –
parseInt ("4F", 16); 1 parseInt ("4F", 16); 25. Explain the difference between “==” and “===”?
“==” checks only for equality in value whereas “===” is a stricter equality test and returns false if either the value or the type of the two variables are different. 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 is the difference between ViewState and SessionState?
|
View Answer
|
|
Between JavaScript and an ASP script, which is faster?
|
View Answer
|
|
What are JavaScript types ?
|
View Answer
|
|
How to delete an entry using JavaScript?
|
View Answer
|
|
How to use strings as array indexes using JavaScript?
|
View Answer
|
|
How to use "join()" to create a string from an array using JavaScript?
|
View Answer
|
|
How to make a array as a stack using JavaScript?
|
View Answer
|
|
How to shift and unshift using JavaScript?
|
View Answer
|
|
How to create an object using JavaScript?
|
View Answer
|
|
How to associate functions with objects using JavaScript?
|
View Answer
|
|
What does break and continue statements do?
|
View Answer
|
|
How to create a function using function constructor?
|
View Answer
|
|
What's Prototypes for JavaScript?
|
View Answer
|
|
How to add Buttons in JavaScript?
|
View Answer
|
|
Example of using Regular Expressions for syntax checking in JavaScript?
|
View Answer
|
|
How to create arrays in JavaScript?
|
View Answer
|
|
How do you convert numbers between different bases in JavaScript?
|
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
|