the for/in/hasOwnProperty solution is from an older version of JS before we had Object.keys - I would strongly recommend never using for/in anymore unless you need to some some low-level inflection work. If not, Object.keys is the winner.