var names = [name for(name in generateNames(product))];
generateNames
just returns an array of column names for various properties in a product.
But what is the whole name for name in thing?
That's an array comprehension.
It's a new feature of Javascript 1.7, and works like Python's list comprehensions.