Saving two properties of an object to an array in an variable