Update index.js

Added missing hasOwnProperty checks to two for .. in loops.