Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

padend method javascript

/* The padEnd() method pads the current string with a given string 
(repeated, if needed) so that the resulting string reaches a given length.
The padding is applied from the end of the current string. */

const str1 = 'Breaded Mushrooms';

console.log(str1.padEnd(25, '.'));
// expected output: "Breaded Mushrooms........"

const str2 = '200';

console.log(str2.padEnd(5));
// expected output: "200  "
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #padend #method #javascript
ADD COMMENT
Topic
Name
8+6 =