.padStart(val,num)

Description

Padstart returns the original string with the start padded out using the input values

Parameters

The first parameter specifies what string should be used to pad out the original, and the second is a number that specifies how many times that string should be repeated.

Usage On Strings

num = "1"

log num.padStart("0",10)
// 0000000001

Last updated

Was this helpful?