Hello all, Sometime you need to convert your strings with number or numbers to string in javscript.
You can use some javascript functions for it.
- Number() function
- parseInt()
- parseFloat()
Let’s talk about first one.
<script> const a = "5"; Number(a); </script>
Above code will show a as 5.
Now let’s see parseInt() method
<script> const a = "5"; parseInt(a); </script>
Above code will show a as 5.
Same will work for parseFloat().