OK, I see. I used an anonymous function - you’ve created a named one. That can work too.
I see two issues. First, You are calling the function. Do we want to call it? What did we say we need to do in the outer function? We need to return a function. The other (minor) issue is that that is a bad name for the inner function - it is not specific to Paul.
Closure is happening all the time in JS. It’s just one of those things that when I try to understand it it seems more complicated than it is. It is a weird subject.
yes now i have correctly what i want to output, now i need to understand how can work with more complex rules, for example:
Implement the createStore function which creates an empty array of products and adds a closure that deals with adding products to the store. For each product added to the store run the console.log of the entire store
Go ahead and start a new thread for this so we can keep things cleaner. Plus, others may want to join the party. I’m going to have to go do some business but I can take a look when I get back.