Arrow Functions and Template Literals
Arrow functions are a short way to write functions. Template literals use backticks so you can embed values with ${...}.
- const greet = (name) => `Hello, ${name}!`;
- Use backticks `, not quotes, for templates.
- Arrow functions do not bind their own this.
const greet = (name) => `Hello, ${name}!`;
console.log(greet("StudyTonight"));
After you read this chapter, use Write (when available) and Quiz on this page to lock it in.