Exercise 6-Mine is working but need explanation


So I wrote this and it works fine but I am confused on how this is working, So i pass a value onto the parameter "pm". then it runs the for-in loop. so does the value on "pm" assign to the variable firstName in the for in loop?

Thank you.

var list = function(pm)
for(firstName in friends)



no, firstName gets assigned the value from the friends object. You can access objects which are declared outside a function from inside a function


Thank you, so then what's the point of the function's parameter?


None? The function doesn't require a parameter


Oh i thought it did! I guess it just to run it then!
Thank you!!