int
Commons
stable
Thin wrapper around parseInt with a default radix of 10. Accepts both string and number inputs.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- valuerequisstring | number
- The value to parse. Strings are parsed as integers; numbers are passed to parseInt directly.
- radixnumber10
- The base for the parseInt call. Defaults to 10 (decimal). Use 16 for hex strings.
API
Valeur de retour
La valeur retournée par cet util.
- The parsed integer. Returns NaN for non-numeric input (same as parseInt behaviour).
Usage
Exemples
Extraits de code prêts à coller.
Parse integers from strings