Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
converts its first argument to a string
The parseInt function converts its first argument to a string, parses that string, then returns an integer or NaN.
The parseInt function converts its first argument to a string, parses that string, then returns an integer or NaN.
The parseInt function converts its first argument to a string, parses that string, then returns an integer or NaN.
The parseInt function converts its first argument to a string, parses that string, then returns an integer or NaN.
parseInt() does not handle BigInt values. It stops at the n character, and treats the preceding string as a normal integer, with possible loss of precision.
Using parseInt() on non-strings
parseInt() can have interesting results when working on non-strings combined with a high radix; for example, 36 (which makes all alphanumeric characters valid numeric digits).
This page was last modified on Jul 8, 2025 by MDN contributors.