Sha256: 322f5c75a100e0d400284aaae321b3b7e5fad1c7f2e5c3f2383565bf8a5184eb
Contents?: true
Size: 741 Bytes
Versions: 14
Compression:
Stored size: 741 Bytes
Contents
/** * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence. * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence. */ observableProto.sum = function (keySelector, thisArg) { return keySelector && isFunction(keySelector) ? this.map(keySelector, thisArg).sum() : this.reduce(function (prev, curr) { return prev + curr; }, 0); };
Version data entries
14 entries across 7 versions & 1 rubygems