Hey there, I'm currently facing an issue with a piece of JavaScript code. I'm trying to create a function that will notify me whether or not a specific item is in the basket.
const amazonBasket = {
glasses: 1,
books: 2,
floss: 100,
};
function checkBasket(basket, lookingFor) {
for (item in basket) {
if (item === lookingFor) {
return `${lookingFor} is in your basket`;
}
}
return `That item is not in your basket`;
}
checkBasket(amazonBasket, camera);