Get specific variable from an array of objects