Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

padstart javascript

let str1 = '123';
let val = str1.padStart(6, '0'); 
console.log(val);	// "000123"
let val2 = str1.padStart(6, '*'); 
console.log(val2);	// "***123"
 
PREVIOUS NEXT
Tagged: #padstart #javascript
ADD COMMENT
Topic
Name
5+8 =