How to convert “20” to number in javascript?



How to convert “20” to number in javascript?..

Answer / Vivek Pati Tripathi

You can use the unary plus operator (+) or the `parseInt()` function to convert a string into a number. So, you would write either `+'20'` or `parseInt('20')`. Both will return 20.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Explain a story about javascript performance problems?

1 Answers  


What is an immediately-invoked function expression?

1 Answers  


Which is faster jquery or javascript?

1 Answers  


What is built in function in javascript?

1 Answers  


Where can I learn javascript for free?

1 Answers  


What is difference between scripting and programming?

1 Answers  


Explain how to detect the operating system on the client machine?

1 Answers  


What is closure?

1 Answers  


How do you assign object properties?

3 Answers   Satyam,


hello sir my name is naga sekhar i completed my b-tech in 2011 with 61% in IT streme.I completed my core and advanced java coure before 8months back.Still i did not get the job.i tried so many times.and i went to some interviews but no use.now i want to get the job in software sector

1 Answers  


How to reload the current page?

1 Answers  


Why is my javascript function not defined?

1 Answers  


Categories