Quick JS: Template Literals
An older post brought over from my previous site. Some formatting from the original didn't survive the move.
My daily JavaScript journey has brought me to some es6 fundamentals. I wanted to start to build things that were more complicated than some DOM manipulation. I have been going through some courses, and naturally, the instructor has been showing us some of the differences between es5 and es6. As I go back and learn some of the fundamentals of the language it is also nice to see where things are going next and new ways to do some things.
Lets take a look at a new way you can make multi line string templates. const button = I Am A Button ; const cssJS = body { background: red; }; The biggest things to note are the backticks. The example below shows that while small, it makes things simpler and more readable.