I'm a beginner and I'm taking an interactive online class. Closures were the topic of discussion today. The following question was asked, "How many closures are created in the following code?".
function addUp (c, d) {
return c + d;
}
function doubleDown (c) {
return addUp(c, c);
}
I said two and my answer was based on this. I was told the answer is one closure is created. The reason given was convoluted and obviously didn't make sense to me. I've read over this, this, and this where the following statement is made:
So my question is where am I going wrong with my interpretation of closures? Any additional resources I can be pointed to will be appreciated.