UNPKG

726 BJavaScriptView Raw
1'use strict';
2// TODO: Remove from `core-js@4`
3var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
4var $group = require('../internals/array-group');
5var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');
6
7var aTypedArray = ArrayBufferViewCore.aTypedArray;
8var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
9
10// `%TypedArray%.prototype.groupBy` method
11// https://github.com/tc39/proposal-array-grouping
12exportTypedArrayMethod('groupBy', function groupBy(callbackfn /* , thisArg */) {
13 var thisArg = arguments.length > 1 ? arguments[1] : undefined;
14 return $group(aTypedArray(this), callbackfn, thisArg, typedArraySpeciesConstructor);
15}, true);