scrimba
Frontend Career Path
Getting hired
JavaScript Interview Challenges
Solution - Emoji Flower Bed
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

AboutCommentsNotes
Solution - Emoji Flower Bed
Expand for more info
index.js
run
preview
console
/*
Oh no, our emoji flower bed is infested with mammals, trees and leaves!
Without changing the API url, write a function to transform your
data before it's displayed. The function should eliminate
everything but bugs and flowers. Use your function in the API call.

Hint: Be sure to console the data to see what properties can help you do this!
*/

const url = 'https://apis.scrimba.com/emojihub/api/all/category/animals-and-nature';
const flowerBed = document.querySelector('.emoji-flower-bed');

function clearTheGarden(arr){

}


fetch(url)
.then(response => response.json())
.then((data) => {
data.forEach(emoji => {
flowerBed.innerHTML += `<li>${emoji.htmlCode}</li>`;
});
})
.catch(err => console.log(err));



Console
/index.html
-1:53