Loop elements of an object