refactored to not overwrite existing values if Array.prototype already has them