We Made A Friend! Question


#1

Continuing the discussion from 6.) We Made A Friend! I am so rusty:

the
I'm a bit confused with this code, because how does the program know which argument to listen to? By that I mean, since there's two firstNames, which one will JavaScript fulfill with the first name?

Thanks!


#2

One is a key, and one is a value.

firstName on the left is what you call, and firstName on the right is the value for it.

Have you done for loops yet? It's how with arrays, you use array[i] to call on parts of the array. i is the key, and the value returned is the value.


#3

This is actually a good explanation.
Also sorry if my explanation of that code was shabby in the other topic.


#4

Of course, it is. I made it.

edit: That makes me seem exuberantly cocky which I'm not.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.