- Multiline strings
- Easy syntax for passing variables
- Expression Interpolation
In this post, we’ll be going through each feature in code snippets.
You’ll see the power of both in the code example below, with a comparison of what it’s like in ES5 vs ES6.
As you can see, the ES6 syntax is a lot cleaner and easier to use when you to include multiple lines in a single string or variables. One thing it definitely increases is code readability. If you wanted to use the ES5 syntax, you’d have to insert line breaks, if the string is too long, you have to concatenate — in short too unwieldy.
With that said, I hope this post helps you improve your code, and if you have any suggestions please comment down below!