scrimba
Note at 0:05
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

Note at 0:05
AboutCommentsNotes
Note at 0:05
Expand for more info
index.js
run
preview
console
/* Challenge 1: Favorite Foods
- Topic: Object Destructuring
1. Edit the faveFoods object so that it contains
your favorite foods.
2. Destructure the faveFoods object into three consts:
breakfast, lunch, and supper.
3. Fetch the meals <section> from the DOM.
4. Set the innerHTML content of the meals <section> to a paragraph
that states what your favorite foods are for breakfast, lunch, and supper.
Use a template literal to construct the string.

E.g.
For breakfast, I only like croissants 🥐. For lunch, I love pasta 🍝,
and for supper I want usually want pizza 🍕.
*/

const faveFoods = {
breakfast: 'croissants 🥐',
lunch: 'tuna sandwiches 🥪',
supper: 'pizza 🍕'
}

const { breakfast, lunch, supper } = faveFoods;
console.log(breakfast);
console.log(lunch);
console.log(supper);

const meals = document.getElementById("meals");

meals.innerHTML = `
<p>
For breakfast, I only like ${breakfast}. I love ${lunch} for lunch, and I usually want ${supper} for supper.
</p>
`;
Console
"croissants 🥐"
,
"tuna sandwiches 🥪"
,
"pizza 🍕"
,
/index.html
LIVE