diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b560f2d..b88554cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -579,6 +579,7 @@ A total of 6 people contributed to this release. Thank you to the following cont
+- [`abb0dc3`](https://github.com/stdlib-js/stdlib/commit/abb0dc38783210623e67f19a5bb95b3998f75ff7) - **docs:** update examples and descriptions _(by Athan Reines)_ - [`95d0bbc`](https://github.com/stdlib-js/stdlib/commit/95d0bbc4b76c57dba4b4edd343dcd046490d4a51) - **bench:** test for primitive value _(by Athan Reines)_ - [`c712a8e`](https://github.com/stdlib-js/stdlib/commit/c712a8ec07db672a01355ddfca2192be25fe85ca) - **feat:** add `array/base/broadcasted-ternary4d` [(#3232)](https://github.com/stdlib-js/stdlib/pull/3232) _(by Vinit Pandit, Athan Reines)_ - [`28db4f2`](https://github.com/stdlib-js/stdlib/commit/28db4f2869749f6a6d6f7ae6476bd27f65052e96) - **feat:** add `array/base/mskunary4d` [(#3208)](https://github.com/stdlib-js/stdlib/pull/3208) _(by Abhijit, Athan Reines)_ diff --git a/fixed-endian-factory/README.md b/fixed-endian-factory/README.md index 0bfcb8df..481f350b 100644 --- a/fixed-endian-factory/README.md +++ b/fixed-endian-factory/README.md @@ -316,6 +316,7 @@ Returns an array element located at integer position (index) `i`, with support f var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +// returns var out = arr.at( 0 ); // returns 1.0 @@ -330,6 +331,7 @@ If provided an out-of-bounds index, the method returns `undefined`. var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +// returns var v = arr.at( 100 ); // returns undefined @@ -352,12 +354,13 @@ function isNegative( v ) { var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', [ -1.0, -2.0, -3.0, -4.0 ] ); +// returns var bool = arr.every( isNegative ); // returns true ``` -The invoked function is provided three arguments: +The `predicate` function is provided three arguments: - **value**: current array element. - **index**: current array element index. @@ -374,6 +377,7 @@ function isPositive( v, i ) { var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, -3.0 ] ); +// returns var context = { 'count': 0 @@ -400,6 +404,7 @@ function log( v, i ) { var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', 3 ); +// returns arr.set( 1.5, 0 ); arr.set( 2.5, 1 ); @@ -430,6 +435,7 @@ function fcn( v, i ) { var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', 3 ); +// returns var context = { 'count': 0 @@ -455,6 +461,7 @@ Returns an array element located at a nonnegative integer position (index) `i`. var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', 10 ); +// returns // Set the first element: arr.set( 1.0, 0 ); @@ -470,6 +477,7 @@ If provided an out-of-bounds index, the method returns `undefined`. var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', 10 ); +// returns var v = arr.get( 100 ); // returns undefined @@ -537,6 +545,7 @@ Serializes an array as a string. var Float64ArrayFE = fixedEndianFactory( 'float64' ); var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] ); +// returns var str = arr.toString(); // returns '1,2,3' diff --git a/fixed-endian-factory/lib/main.js b/fixed-endian-factory/lib/main.js index 1dc8f0f2..64708668 100644 --- a/fixed-endian-factory/lib/main.js +++ b/fixed-endian-factory/lib/main.js @@ -545,7 +545,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli * @memberof TypedArray.prototype * @type {Function} * @param {Function} predicate - predicate function - * @param {*} [thisArg] - function invocation context + * @param {*} [thisArg] - predicate function execution context * @throws {TypeError} `this` must be a typed array instance * @throws {TypeError} first argument must be a function * @returns {boolean} boolean indicating whether all elements pass a test