to integer javascript method code example Example 1: string to number js let myNumber = Number("5.25"); //5.25 Example 2: javascript to number parseInt("1")