|
| 1 | +# Day 8: ES6+ Features 🚀 |
| 2 | + |
| 3 | +Welcome to Day 8 of our JavaScript workshop! Today, we will dive into some of the powerful features introduced in ES6 and beyond. 🌟 |
| 4 | + |
| 5 | +## Learning Objectives 📚 |
| 6 | + |
| 7 | +By the end of these activities, you will: |
| 8 | +- Understand and use template literals for string interpolation and multi-line strings. |
| 9 | +- Apply destructuring to extract values from arrays and objects. |
| 10 | +- Utilize spread and rest operators for array manipulation and function arguments. |
| 11 | +- Define functions with default parameters. |
| 12 | +- Create objects using enhanced object literals, including methods and computed property names. |
| 13 | + |
| 14 | +## Activities 🛠️ |
| 15 | + |
| 16 | +This workshop is divided into several activities: |
| 17 | + |
| 18 | +### Activity 1: Template Literals ✨ |
| 19 | + |
| 20 | +- [ ] **Task 1:** Use template literals to create a string that includes variables for a person's name and age, and log the string to the console. |
| 21 | +- [ ] **Task 2:** Create a multi-line string using template literals and log it to the console. |
| 22 | + |
| 23 | +### Activity 2: Destructuring 🛠️ |
| 24 | + |
| 25 | +- [ ] **Task 3:** Use array destructuring to extract the first and second elements from an array of numbers and log them to the console. |
| 26 | +- [ ] **Task 4:** Use object destructuring to extract the title and author from a book object and log them to the console. |
| 27 | + |
| 28 | +### Activity 3: Spread and Rest Operators 📌 |
| 29 | + |
| 30 | +- [ ] **Task 5:** Use the spread operator to create a new array that includes all elements of an existing array plus additional elements, and log the new array to the console. |
| 31 | +- [ ] **Task 6:** Use the rest operator in a function to accept an arbitrary number of arguments, sum them, and return the result. |
| 32 | + |
| 33 | +### Activity 4: Default Parameters 🔧 |
| 34 | + |
| 35 | +- [ ] **Task 7:** Write a function that takes two parameters and returns their product, with the second parameter having a default value of 1. Log the result of calling this function with and without the second parameter. |
| 36 | + |
| 37 | +### Activity 5: Enhanced Object Literals ⚙️ |
| 38 | + |
| 39 | +- [ ] **Task 8:** Use enhanced object literals to create an object with methods and properties, and log the object to the console. |
| 40 | +- [ ] **Task 9:** Create an object with computed property names based on variables and log the object to the console. |
| 41 | + |
| 42 | +## Feature Requests (Optional) 🎨 |
| 43 | + |
| 44 | +1. **Template Literals Script:** Write a script that demonstrates the use of template literals to create and log strings with embedded variables and multi-line strings. |
| 45 | +2. **Destructuring Script:** Create a script that uses array and object destructuring to extract values and log them. |
| 46 | +3. **Spread and Rest Operators Script:** Write a script that demonstrates the use of the spread operator to combine arrays and the rest operator to handle multiple function arguments. |
| 47 | +4. **Default Parameters Script:** Create a script that defines a function with default parameters and logs the results of calling it with different arguments. |
| 48 | +5. **Enhanced Object Literals Script:** Write a script that uses enhanced object literals to create and log an object with methods and computed property names. |
0 commit comments