I have an array like below:
let totalArr = ["First","Second","Third","Fourth","First","Second", "Second"]
My Required output is:
let grouper = [["First","First"],["Second", "Second", "Second"],["Third"], ["Fourth"]]
can anybody give optimal iterations?