Groups an array based on callback return value
groupBy([6.1, 4.2, 6.3], Math.floor)// [ [4, [4.2]], [6, [6.1, 6.3]] ]groupBy(['one', 'two', 'three'], v => [v.length, v.includes('a')])// [ [[5, false], ['three']], [[3, false], ['one', 'two']] ] Copy
groupBy([6.1, 4.2, 6.3], Math.floor)// [ [4, [4.2]], [6, [6.1, 6.3]] ]groupBy(['one', 'two', 'three'], v => [v.length, v.includes('a')])// [ [[5, false], ['three']], [[3, false], ['one', 'two']] ]
Groups an array based on callback return value