For the complete documentation index, see llms.txt. This page is also available as Markdown.

number.padStart

⚠️ Not a number method. .padStart() works only on strings. See strings/.padstart.md.

Description

Treats the number as a string and returns a new string of length num, padded on the left with val (repeated as needed).

Parameters

  • val - padding string.

  • num - total desired length.

Usage

log 7.padStart("0",3) // "007"

Last updated