Learn Basic OOP by Building a Shopping Cart - Step 8

Tell us what’s happening:

I do not know how to write an empty callback function in arrow syntax

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

products.forEach() => {

};

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0

Challenge Information:

Learn Basic OOP by Building a Shopping Cart - Step 8

Hi there and welcome to our community!

The callback function goes inside the parentheses of the forEach() method.
So, call the forEach() method on products and then put the empty callback function inside the parentheses.
The callback function will specify what is to be done with each of the objects in the products array. For now, you add an empty function.

You’ve slightly conflated two things in your code, in that you’ve used the method parentheses also as the parentheses for the arrow function.

Add another pair of parentheses before the arrow and then move them and the arrow and curly braces inside the first set of parentheses.

This is an empty callback function:

() => {}