Getting IN-timate (question on property placeholder)


The code is correct, I am just wondering why anything can be used as the placeholder for property. Why isn't there a specific word such as "property" that is used to print out all the elements in an object?

Replace this line with your code.


There is no specific keyword since programmers need freedom to name their variables to fit the implementation in a semantic way.

for (var key in object)

is the pattern, but we can name things whatever we wish.

for (var item in items)

for (var friend in friends)



Makes sense, Thank you.


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