Javascript, Meal Maker Project question

Hi Everybody!

I’m in the middle of the Javascript Meal Maker Project in which I ended up having to watch the step by step video as I was stuck. I’m now trying to understand the code in it and I have a question about this particular task 8:

My question is, why use the square brackets ‘[ ]’ instead of parenthesis ‘( )’ on ‘courseName’? I went back on the previous lessons to see if I could find the answer to that bu no luck… is it because ‘courseName’ has to be pushed into an array so it uses the square brackets to specify that?

square brackets are used when we want the value of a object property/associative array key

using parenthesis would make attempt a function call

Thank you very much!