Join Carl Peaslee for an in-depth discussion in this video Template literals, part of React: ES6, ES2016, and Beyond.
- [Instructor] Now let's take a second to check out…the template literal syntax.…Template literals allow us to construct strings…in a more concise way.…We'll open up our templateLiterals.js file,…and herein I've got an example.…You can see when I want to initialize a template literal,…I use the backtick instead of the single quotes…or double quotes.…And once I've initialized a template literal,…I can then insert variables directly into the string…by using the dollar sign or bling and then code brace.…So here you can see I've made sort of a Mad Libs…by coming up with a story,…and then inserting my variables into it.…
I encourage you to try out the template literal…and see how it works for you.…There are a number of applications for template literals,…but one that we'll be using in our project…is to construct our query for our GraphQL query.…Let's go now to our application.…In our application we're going to open up our utils.js file.…And remember how here in our body we said…we'll get to this later?…Let's get to it now.…
- Using const and let
- Importing and exporting modules
- Arrow functions
- Destructing assignments
- Arguments and template literals
- Extended parameter handling with the spread operator
- Generating custom styles
- Classes, getters and setters
Skill Level Intermediate
1. Variables and Declarations
2. Arguments and Template Literals
4. Promises and Async
- 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.Cancel
Take 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.