jskatas.org Continuously Learn JavaScript. Your Way.

Number API: Number.parseInt()

Number.parseInt() parses a string and returns an integer.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

Number.parseInt() parses a string and returns an integer.

  • it is a static function on Number
  • is the same as the global function parseInt
  • parseInt was specified in ECMAScript v1 (please find that ES1 kata for learning more)

Links

Description of `Number.parseInt()` in the specification.
The MDN docs for this function.
Spec chapter of the global `parseInt()` function.
A twitter thread, where I explained the decision process of the creation of this kata and how it relates to the ES1 kata of this function.