An ESnext spec-compliant `Array.prototype.groupToMap` shim/polyfill/replacement that works as far down as ES3.