scrimba
JavaScriptmas 2022
JavaScriptmas: 🌮 Taco Tray
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

JavaScriptmas: 🌮 Taco Tray
AboutCommentsNotes
JavaScriptmas: 🌮 Taco Tray
Expand for more info
index.js
run
preview
console
// Challenge 4: Taco Tray
// - Help our chef fill a tray with tacos!

function getRandomNumberOfTacos() {
/*
Make this function return an array that contains
between one and ten taco emojis 🌮
Use the following JavaScript concepts:
- Math.random()
- Math.floor()
- new Array()
- Array.fill()
*/

return ['Empty Tray'] // replace this empty tray array

}

function putTacosOnTray() {
return getRandomNumberOfTacos().map(function (taco) {
return `<div class="taco">${taco}</div>`
}).join('')
}

document.getElementById('tray').innerHTML = putTacosOnTray()
Console
/index.html
-6:45