Answers for "chage a string '123' to a number in js"

6

how to change a string to number in javascript

let theInt = parseInt("5.90123"); //5
let theFloat = parseFloat("5.90123"); //5.90123
Posted by: Guest on May-03-2020
0

JS convert a string into a number

const three = "3";
typeof(three);
// 'string'

const threeInt = parseInt(three, 10);
typeof(threeInt);
// 'number'
Posted by: Guest on September-15-2021

Code answers related to "chage a string '123' to a number in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language