JS Built-ins
GlobalFunctionsparseIntbeginner

parseInt β€” basic integer string

πŸ“– Usage Example
parseInt('42')         // β†’ 42
typeof parseInt('42')  // β†’ 'number'

parseInt() parses a string and returns the first integer it finds.

parseInt

parseInt('42') returns the integer 42.

Challenge: Verify that parseInt('42') === 42.

πŸ’‘ Hints (1)
  • β€’ parseInt converts a string to an integer.