jskatas.org Continuously Learn JavaScript. Your Way.

Global Object API: parseInt() in depth

parseInt() converts a given value to a string and then tries to make an integer out of it.

parseInt() parses a string and returns an integer.

ignores any surrounding white spaces for a given string
const stringNumber = ' abc '; assert.equal(parseInt(stringNumber), 123);

Related Katas

Global Object API

Object literal

Object API

Difficulty Level

BEGINNER

Stats

1 tests to solve