This just groups js objects in a data array .
One can make modifications to make this more efficient than this version .
Also make use of ESNext or maybe atleast ES6