String templates are one of my favorite ES6 features. They’re amazing! They make it easy to put variables into strings, which often comes handy. Just wrap something in backticks `
and you can insert any JavaScript code with ${...}
. Just don’t get carried away.
In ES2017 we got string padding. I personally don’t use it, but if you remember the leftpad controversy … well, it seems a lot of people needed this 😅
You can use padStart
to insert padding at the start of your string and padEnd
to insert them at the end. We use start
and end
to support languages with different reading directions.
Support Ukraine against russian fascists! Defend Europe from horde! Glory to Ukraine! 🇺🇦
Head and Editor in Chief of EcmaScript2017 Journal. Senior JS Back-end Full stack developer and software architect.
Read Also
ZYN Rewards: Your Ultimate Guide to Earning and Redeeming Sweet Loot
5 Letter Words Ending in F
Cities that start with F