- Template Literals
Use backticks (`
) to easily insert variables into strings with ${}
.
const name = "John";
const message = `Hello, ${name}!`;
- Spread Operator
...
Spread array or object elements into another array/object or function.
const numbers = [1, 2, 3];
const moreNumbers = [...numbers, 4, 5]; // [1, 2, 3, 4, 5]
- Destructuring
Quickly extract values from arrays or objects.
const person = { name: "Alice", age: 25 };
const { name, age } = person;
Top comments (0)