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

/*
Use reduce() and only reduce() to calculate and return
the total cost of only the savory
items in the shopping cart.

Expected output: 9.97
*/

function totalSavory(arr){

}

console.log(totalSavory(shoppingCart));

Console
undefined
,
/index.html
-0:44