JavaScript数値Number.parseInt
Math.cos

Number.parseInt数値

Number.parseFloat

文字列を整数に変換します。

문법

Number.parseInt(string, radix?)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

console
parseInt
console.log(Number.parseInt("42"));        // 42
console.log(Number.parseInt("0xFF", 16));  // 255
console.log(Number.parseInt("3.14"));      // 3