Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

padstart and padend javascript

//padstart 
const str1 = '123';
str1.padStart(3, '0'); // "00123"
str1.padStart(3, '*'); // "**123"

//padstart 
str1.padEnd(3, '0'); // "12300"
str1.padEnd(3, '*'); // "123**"
 
PREVIOUS NEXT
Tagged: #padstart #padend #javascript
ADD COMMENT
Topic
Name
8+9 =