javascript num code example Example 1: javascript number length var num = 1234 number.toString().length; // 4 Example 2: javascript to number parseInt("1")