Are “id”, “prop”, and “value” KEYWORDS? For example, is it because of the syntax that the system knows “id” is our id number for each album?
Does the system know “prop” is the NESTED property? (Because the album ID numbers are also properties, but they are “first level” properties.)
I’m confused about how I would ever know this without copying what Quincy did. I mean, to use “id, prop, value” as the names of the parameters. The first condition in our if statement is “if(value === “”)” and I understand that this is saying “if the value is blank”, but how does the system know what “value” is? I mean, since “collection” is an object filled with objects, technically each nested object is also a “value”.
Any clarifying comments would be greatly appreciated
you could have written function (mushroom, banana, apple) {...} and it would have worked the same (if apple is an empty string do that etc), it makes most sense to use variable names related to what you are using that variable for
Thanks, yeah, that’s what I thought. I realized what was messing up my head. The instructions say “If value is empty, delete the given prop property” and I had been thinking that it meant if the value was empty in the array, but it meant in the parameters that we put in the function. Okay, that makes more sense now. I really appreciate that you took time to answer!
If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.