To use the padStart
function from the lodash library in TypeScript, you need to install the library and its types.
You can do so via npm by running the following command:
index.ts33 chars2 lines
Then you can import the padStart
function like this:
index.ts108 chars5 lines
The padStart
function takes three arguments:
In the example above, the resulting string should have a length of 5, so two zeroes are added to the beginning of the string.
gistlibby LogSnag