javascript val to number code example Example 1: tonumber javascript number = parseInt("010"); // number = 10 Example 2: javascript to number parseInt("1")