Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

padstart in javascript

//The padStart() method pads the current string with another string 
//(multiple times, if needed) until the resulting string reaches the given
const hours='2'
console.log(hours.padStart(2, 0))
//console '02'
 
PREVIOUS NEXT
Tagged: #padstart #javascript
ADD COMMENT
Topic
Name
7+4 =