scrimba
JS Deep Dive
Arrays & Sets
Challenge: Array Destructuring
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Challenge: Array Destructuring
AboutCommentsNotes
Challenge: Array Destructuring
Expand for more info
index.js
run
preview
console
// 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;
let regularFishDishes;

let chefsMeatDishes;
let regularMeatDishes;


// Finally, use the spread operator to create these two arrays as well
let chefsDishes;
let regularDishes;
Console
/index.html
-3:58