Tell us what’s happening:
Hey there!
I am trying to solve the quest but I have an issue in understanding the “prop” variable. As I understand the user story, I have to create a variable named “prop” first with reference to the data “artist” and “tracks”. A container for the metadata so to speak. I took a glance on the solution because and it seems creating a variable named “props” is not necessary at all…I just do not get why. How does the code know, that I refer to “tracks” or “artist” when I use “prop” in switch or if/else-statement to create the given conditions? I just can’t wrap my head around it Thanks for your help!
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:78.0) Gecko/20100101 Firefox/78.0
When you define functions, you can add any number of parameters you want.
The body of the function will be able to read and access the arguments that gets passed to it.
For example imagine a function like this:
function isEven(number) {
return number % 2 === 0
}
The above is a function called isEven that accept a parameter, which in the context of the function is “called” number.
So when I invoke it, I can pass whichever value I want, and on each execution the argument will be different.