How do you convert numbers between different bases in JavaScript?

 Posted by vishalneeraj-24503 on 1/13/2014 | Category: JavaScript Interview questions | Views: 889 | Points: 40
Answer:

We use the parseInt() javascript function,that takes a string as the first parameter,and the base as a second parameter.

So to convert hexadecimal 5F to decimal,we can write as:-
parseInt("5F",16);


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response