Home/Tutorials/JavaScript/Arrow Functions and Template Literals

0 of 3 saved

JavaScript5 min read

Arrow Functions and Template Literals

Read this chapter, write the program on this page, then pass a short check to open the next one.

Short functions and string interpolation.

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.