Split array of objects with different properties names into an object and separate them by a given n