Skip to content

Glossary: JavaScript Basics

Number (conversion)

Also written: Number(), Number(text)

A function that converts a whole string to a number, or gives `NaN` if it can't. Use it on text from forms, files and the command line before doing math.

Where the book teaches it

Related terms

NaNparseInt / parseFloatType coercion