Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/School-Work / School Work/Array Destructuring./index.js |
| Date | Not specified in source |
| Repository | Janady13/School-Work |
| Revision | 4a666c890caf7c43c47d0572dbcc287373c7a78e |
| Branch | main |
| Path or archive member | School Work/Array Destructuring./index.js |
| Original SHA-256 | 4e952a791c58dd36a12c1a69e9aea6b73b8670fef2ac1c3c6d6739dc88fed5c1 |
| Git blob SHA | ddfa5cd71747ed4506b457730cb94b191a22d34b |
| Reading-copy SHA-256 | 4e952a791c58dd36a12c1a69e9aea6b73b8670fef2ac1c3c6d6739dc88fed5c1 |
Recovered source transcript
Download complete source text ↓18 lines · 0.8 KB
// Challenge:
// In our restaurant, the chef has some favourite dishes in two different categories.
// The chef loves all dishes that start with "S", while the rest are regular dishes
// Use array destructoring to create arrays of the chefs favourite dishes of meat and
// fish, and to create arrays of the regular meat and fish dishes
const fishDishes = ['Salmon Rillettes', 'Grilled Tuna Provencal', 'Fish and Chips']
const meatDishes = ['Lasagna', 'Spaghetti', 'Satay Chicken Skewers']
// Modify these four variables first
let [chefsFishDishes, ...regularFishDishes] = fishDishes
let [regularMeatDishes ,...chefsMeatDishes] = meatDishes;
// Finally, use the spread operator to create these two arrays as well
let chefsDishes = [...chefsMeatDishes, chefsFishDishes]
let regularDishes = [...regularFishDishes, regularMeatDishes]