JavaScript Template Literals In 90 Seconds #JavaScriptJanuary

Channel:
Subscribers:
296,000
Published on ● Video Link: https://www.youtube.com/watch?v=1gX81kmCpVg



Duration: 1:30
4,246 views
169


Watch the entire #JavaScriptJanuary series from the beginning!
https://www.youtube.com/playlist?list=PLkwxH9e_vrALlH7D0XLDn2td-uoHqHFxq

JavaScript template literals are awesome! With template literals we can use multiple lines without using the escaped new line character (\n) or concatenating with the plus symbol (+). We can use double and single quotes freely. And we can include variables, do math calculations, or even call a function that returns a value.

The key to the template literal is the back-ticks. (Pun intended) That’s the key just to the left of the number one key on your keyboard. Now we can format the string more naturally, making it easier to see how the output will look.

To add variables we can use a placeholder by using ${}, then within the placeholder we use an expression. This expression can be a variable, math calculation, or even a function. This is called expression interpolation.

Lastly, there is something called tagged template literals. This is basically passing a template literal into a function.

By doing this we can separate the strings from the expressions and then manipulate them as needed.

I'll be releasing a new video every day in January! Stay tuned..
_____________________________________

📚 Learn to CODE in just a FEW months here:
Treehouse Discount Code: https://treehouse.7eer.net/codeSTACKr
_____________________________________

🛠️ Tools I use:
🟠 Theme: https://marketplace.visualstudio.com/items?itemName=codestackr.codestackr-theme
🟠 Font: STACKr Code (Exclusive to my VS Code Course - https://vsCodeHero.com)
🟠 SuperHero Extension Pack: https://marketplace.visualstudio.com/items?itemName=codeSTACKr.superhero-extensions

🚢 Deploy for FREE on Vercel: https://vercel.com/ambassadors/codestackr
_____________________________________

💖 Show support!
PayPal: https://paypal.me/codeSTACKr
_____________________________________

Watch Next:
Web Development - Beginners Roadmap (2020) - https://youtu.be/iogabydg2y0
Playlist: Web Development For Beginners - https://www.youtube.com/watch?v=Ez4yHS2dsN8&list=PLkwxH9e_vrAJ0WbEsFA9W3I1W-g_BTsbt
_____________________________________

Connect With Me:
Website: http://www.codestackr.com
Twitter: https://twitter.com/codeSTACKr
Instagram: https://instagram.com/codeSTACKr/
Facebook: https://facebook.com/codeSTACKr
_____________________________________

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

#JavaScriptJanuary #31Days31Videos #codeSTACKr







Tags:
JavaScriptJanuary
31Days31Videos
JavaScript
JS
Web Development
Web Dev
Web Development 2020
Web Dev 2020
HTML
CSS
Node.js
Chrome
ES5
ES6
ES7
javascript template
js template
javascript template literal
js template literal
javascript template string
js template string
template literal
template string
template literal string
template string literal
backtick
javascript backtick
js backtick
template literals
template strings