# parseInt()

A function that reads a whole number from the beginning of a string.

## What does **parseInt()** do in JavaScript?

**parseInt()** — A function that reads a whole number from the beginning of a string.

```javascript
const quantity = Number.parseInt("12 items", 10);
```

Level: Apprentice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/apprentice)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/parseint
