diff --git a/lib/node_modules/@stdlib/array/bool/README.md b/lib/node_modules/@stdlib/array/bool/README.md index 540d1c61d037..1d566cd9712d 100644 --- a/lib/node_modules/@stdlib/array/bool/README.md +++ b/lib/node_modules/@stdlib/array/bool/README.md @@ -710,6 +710,35 @@ var str = arr.join( '|' ); // returns 'true|false|true' ``` + + +#### BooleanArray.prototype.keys() + +Returns an iterator for iterating over each index key in a typed array. + +```javascript +var arr = new BooleanArray( 2 ); + +arr.set( true, 0 ); +arr.set( false, 1 ); + +var iter = arr.keys(); + +var v = iter.next().value; +// returns 0 + +v = iter.next().value; +// returns 1 + +var bool = iter.next().done; +// returns true +``` + +The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties: + +- **next**: function which returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished. +- **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object. + #### BooleanArray.prototype.lastIndexOf( searchElement\[, fromIndex] ) @@ -1337,6 +1366,55 @@ var str = arr.toString(); // returns 'true,false,true' ``` + + +#### BooleanArray.prototype.values() + +Returns an iterator for iterating over each value in a typed array. + +```javascript +var arr = new BooleanArray( 2 ); + +arr.set( true, 0 ); +arr.set( false, 1 ); + +var iter = arr.values(); + +var v = iter.next().value; +// returns true + +v = iter.next().value; +// returns false + +var bool = iter.next().done; +// returns true +``` + +The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties: + +- **next**: function which returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished. +- **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object. + + + +#### BooleanArray.prototype.with( index, value ) + +Returns a new typed array with the element at a provided index replaced with a provided value. + +```javascript +var arr = new BooleanArray( 3 ); + +arr.set( true, 0 ); +arr.set( false, 1 ); +arr.set( true, 1 ); + +var out = arr.with( 0, false ); +// returns + +var v = out.get( 0 ); +// returns false +``` + @@ -1419,6 +1497,8 @@ console.log( '%s', false );