marijnh / Eloquent-JavaScript

The sources for the Eloquent JavaScript book
https://eloquentjavascript.net
2.99k stars 789 forks source link

there's String.prototype.padStart() in ES2017 #528

Closed rosald closed 3 years ago

rosald commented 3 years ago

in chapter 'Functions' section 'Growing functions' , we created a function 'printZeroPaddedWithLabel' which add pad '0' to the string. In fact , since ES2017(which the book 3rd edithon use) , there's String.prototype.padStart() and String.prototype.padEnd() who helps pad the string . How about add these related contents to the page footer to make it clear

rosald commented 3 years ago

i see String.prototype.padStart() , in next chapter 'Data Structures: Objects and Arrays' section 'Strings and their properties' ....

marijnh commented 3 years ago

Indeed, it is mentioned later, when methods are introduced.