scrimba
Frontend Career Path
Getting hired
JavaScript Interview Challenges
Challenge - Holiday Gift Shopping
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 - Holiday Gift Shopping
AboutCommentsNotes
Challenge - Holiday Gift Shopping
Expand for more info
index.js
run
preview
console
import products from "./data.js";

/*
You're online shopping for holiday gifts, but money is tight
so we need to look at the cheapest items first.
Use the built in sort() method to write a function that returns a new array of
products sorted by price, cheapest to most expensive.

Then log the item and the price to the console:

💕,0
🍬,0.89
🍫,0.99
🧁,0.99
📚,0.99
... continued
*/

function sortProducts(data){

}

const listByCheapest = sortProducts(products);
console.log(listByCheapest);


Console
undefined
,
/index.html
-0:55