
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.
Read Also
5G Network Dangers: Myth or Reality?
The definition of an Embedded Software Architect
VARIABLE DECLARATIONS