Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

string padStart padEnd

let string = ‘Alice’; 
// padStart() — we assume our string needs to have 10 characters 
string.padStart(10, ‘o’); // returns ‘oooooAlice’
// padEnd() 
string.padEnd(10, ‘o’); // returns ‘Aliceooooo’;
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #string #padStart #padEnd
ADD COMMENT
Topic
Name
8+1 =