Templates strings are an alternative to string concatenation. They allow variables to be injected into string literals to form fully interpolated strings. They also honor newline characters and other breaks within the string literal.
(oriental electronic music)…- We're going to…go back to our little side-by-side adventure here…and do some more comparison.…We're gonna talk about a simple, really,…little feature added in ES6…but it's one of those delightful features.…It's not necessarily hugely groundbreaking…or gonna radically change the way you approach your code…or even express things.…
But it's more delightful in a sense…and that does create less of the visual clutter…that our readers need to deal with.…So, let's talk about a scenario like this.…Let's say that I have name = "Kyle"…and let's say…orderNumber = "123"…and total =…319.72.…
Let's make 319.7.…If I were going to make a string to print out…some message, say I was printing out a receipt, if you will.…It's gonna print out some message…that included these values along with some text.…That message might, for example, look like this:…msg = "Hello, " + name +…", your order",…and at this point, I'm running out of line room…so I wanna break onto the next line.…
So I'm gonna do, you might've seen before the trick of…
Author
Released
6/9/2017This course was created by Frontend Masters. It was originally released on 01/10/2017. We're pleased to host this training in our library.
- The arrow function
- Arrow function variations
- Closures and explicit blocks
- Default values
- Using the gather and spread operators
- Dumping variables
- Concise properties and methods
- Symbols, iterators, and generators
- Optimizing codes for the reader
Skill Level Intermediate
Duration
Views
Related Courses
-
Learning ECMAScript 6
with Eve Porcello2h 4m Beginner -
Learning Functional Programming with JavaScript
with Shaun Wassell59m 23s Intermediate
-
1. Arrow Functions
-
Introduction12m 56s
-
The arrow function5m 43s
-
Arrow function variations11m 51s
-
Promises and this9m 23s
-
Exercise 02m 54s
-
Exercise 0: Solution12m 27s
-
-
2. Block Scope
-
Let vs. var10m 53s
-
Closures and explicit blocks6m 22s
-
Const9m 5s
-
When to Use const3m 57s
-
Exercise 11m 4s
-
Exercise 1: Solution2m 14s
-
-
3. Default Values and the Gather/Spread Operators
-
Default values4m 27s
-
Lazy expressions12m 48s
-
Exercise 21m 26s
-
Exercise 2: Solution2m 6s
-
Babel8m 25s
-
-
4. Destructuring
-
Array destructuring9m 23s
-
Dumping variables4m 14s
-
Nested array destructuring13m 44s
-
Object destructuring7m 12s
-
Nested object destructuring8m 55s
-
Advanced destructuring9m 24s
-
Exercise 351s
-
Exercise 3: Solution3m 43s
-
5. Template Strings
-
Concise properties and methods12m 30s
-
Template strings14m 10s
-
Tag functions10m 43s
-
Exercise 434s
-
Exercise 4: Solution3m 20s
-
-
6. Symbols, Iterators, and Generators
-
Symbols8m 58s
-
Well-known symbols2m 45s
-
Iterators9m 28s
-
Creating a custom Iterator8m 52s
-
Generators9m 11s
-
Computed generator methods2m 50s
-
Exercise 53m 34s
-
Exercise 5: Solution4m 11s
-
Ranges4m 45s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Template strings