{"id":28089305,"url":"https://github.com/stdlib-js/array-bool","last_synced_at":"2025-05-13T12:56:12.603Z","repository":{"id":242298634,"uuid":"805636239","full_name":"stdlib-js/array-bool","owner":"stdlib-js","description":"BooleanArray.","archived":false,"fork":false,"pushed_at":"2025-04-14T01:11:51.000Z","size":879,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T11:22:47.753Z","etag":null,"topics":["array","binary","bool","boolean","booleanarray","data","javascript","mask","node","node-js","nodejs","stdlib","structure","typed","typed-array","types"],"latest_commit_sha":null,"homepage":"https://github.com/stdlib-js/stdlib","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stdlib-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["stdlib-js"],"open_collective":"stdlib","tidelift":"npm/@stdlib/stdlib"}},"created_at":"2024-05-25T03:32:01.000Z","updated_at":"2025-04-14T00:54:06.000Z","dependencies_parsed_at":"2024-06-29T07:26:10.942Z","dependency_job_id":"cb4649bd-4a82-49ed-a841-7c6940d8543a","html_url":"https://github.com/stdlib-js/array-bool","commit_stats":null,"previous_names":["stdlib-js/array-bool"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-bool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-bool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-bool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-bool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdlib-js","download_url":"https://codeload.github.com/stdlib-js/array-bool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948336,"owners_count":21988953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","binary","bool","boolean","booleanarray","data","javascript","mask","node","node-js","nodejs","stdlib","structure","typed","typed-array","types"],"created_at":"2025-05-13T12:56:11.842Z","updated_at":"2025-05-13T12:56:12.592Z","avatar_url":"https://github.com/stdlib-js.png","language":"JavaScript","readme":"\u003c!--\n\n@license Apache-2.0\n\nCopyright (c) 2024 The Stdlib Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n--\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    About stdlib...\n  \u003c/summary\u003e\n  \u003cp\u003eWe believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.\u003c/p\u003e\n  \u003cp\u003eThe library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.\u003c/p\u003e\n  \u003cp\u003eWhen you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.\u003c/p\u003e\n  \u003cp\u003eTo join us in bringing numerical computing to the web, get started by checking us out on \u003ca href=\"https://github.com/stdlib-js/stdlib\"\u003eGitHub\u003c/a\u003e, and please consider \u003ca href=\"https://opencollective.com/stdlib\"\u003efinancially supporting stdlib\u003c/a\u003e. We greatly appreciate your continued support!\u003c/p\u003e\n\u003c/details\u003e\n\n# BooleanArray\n\n[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] \u003c!-- [![dependencies][dependencies-image]][dependencies-url] --\u003e\n\n\u003e Boolean array.\n\n\u003c!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"intro\"\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.intro --\u003e\n\n\u003c!-- Package usage documentation. --\u003e\n\n\u003csection class=\"installation\"\u003e\n\n## Installation\n\n```bash\nnpm install @stdlib/array-bool\n```\n\nAlternatively,\n\n-   To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]).\n-   If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions).\n-   For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]).\n\nThe [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships.\n\nTo view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.\n\n\u003c/section\u003e\n\n\u003csection class=\"usage\"\u003e\n\n## Usage\n\n```javascript\nvar BooleanArray = require( '@stdlib/array-bool' );\n```\n\n\u003ca name=\"constructor\"\u003e\u003c/a\u003e\n\n#### BooleanArray()\n\nCreates a boolean array.\n\n```javascript\nvar arr = new BooleanArray();\n// returns \u003cBooleanArray\u003e\n```\n\n#### BooleanArray( length )\n\nCreates a boolean array having a specified `length`.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 10\n```\n\n#### BooleanArray( booleanarray )\n\nCreates a boolean array from another boolean array.\n\n```javascript\nvar arr1 = new BooleanArray( [ true, false, false, true ] );\n// returns \u003cBooleanArray\u003e\n\nvar arr2 = new BooleanArray( arr1 );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr2.length;\n// returns 4\n```\n\n#### BooleanArray( typedarray )\n\nCreates a boolean array from a [typed array][@stdlib/array/typed].\n\n```javascript\nvar Uint8Array = require( '@stdlib/array-uint8' );\n\nvar buf = new Uint8Array( [ 1, 0, 0, 1 ] );\n// returns \u003cUint8Array\u003e[ 1, 0, 0, 1 ]\n\nvar arr = new BooleanArray( buf );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 4\n```\n\n#### BooleanArray( obj )\n\nCreates a boolean array from an array-like object or iterable.\n\n```javascript\n// From an array of booleans:\nvar arr1 = new BooleanArray( [ true, false, false, true ] );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr1.length;\n// returns 4\n\n// From an array containing non-booleans:\nvar arr2 = new BooleanArray( [ {}, null, '', 4 ] );\n\nlen = arr2.length;\n// returns 4\n```\n\n#### BooleanArray( buffer\\[, byteOffset\\[, length]] )\n\nReturns a boolean array view of an [`ArrayBuffer`][@stdlib/array/buffer].\n\n```javascript\nvar ArrayBuffer = require( '@stdlib/array-buffer' );\nvar buf = new ArrayBuffer( 240 );\n\nvar arr1 = new BooleanArray( buf );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr1.length;\n// returns 240\n\nvar arr2 = new BooleanArray( buf, 8 );\n// returns \u003cBooleanArray\u003e\n\nlen = arr2.length;\n// returns 232\n\nvar arr3 = new BooleanArray( buf, 8, 20 );\n// returns \u003cBooleanArray\u003e\n\nlen = arr3.length;\n// returns 20\n```\n\n* * *\n\n### Properties\n\n\u003ca name=\"static-prop-bytes-per-element\"\u003e\u003c/a\u003e\n\n#### BooleanArray.BYTES_PER_ELEMENT\n\nStatic property returning the size (in bytes) of each array element.\n\n```javascript\nvar nbytes = BooleanArray.BYTES_PER_ELEMENT;\n// returns 1\n```\n\n\u003ca name=\"static-prop-name\"\u003e\u003c/a\u003e\n\n#### BooleanArray.name\n\nStatic property returning the constructor name.\n\n```javascript\nvar str = BooleanArray.name;\n// returns 'BooleanArray'\n```\n\n\u003ca name=\"prop-buffer\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.buffer\n\nPointer to the underlying data buffer.\n\n```javascript\nvar arr = new BooleanArray( 2 );\n// returns \u003cBooleanArray\u003e\n\nvar buf = arr.buffer;\n// returns \u003cArrayBuffer\u003e\n```\n\n\u003ca name=\"prop-byte-length\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.byteLength\n\nSize (in bytes) of the array.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n// returns \u003cBooleanArray\u003e\n\nvar nbytes = arr.byteLength;\n// returns 10\n```\n\n\u003ca name=\"prop-byte-offset\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.byteOffset\n\nOffset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n\n```javascript\nvar ArrayBuffer = require( '@stdlib/array-buffer' );\n\nvar arr = new BooleanArray( 10 );\n// returns \u003cBooleanArray\u003e\n\nvar offset = arr.byteOffset;\n// returns 0\n\nvar buf = new ArrayBuffer( 240 );\narr = new BooleanArray( buf, 64 );\n// returns \u003cBooleanArray\u003e\n\noffset = arr.byteOffset;\n// returns 64\n```\n\n\u003ca name=\"prop-bytes-per-element\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.BYTES_PER_ELEMENT\n\nSize (in bytes) of each array element.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n// returns \u003cBooleanArray\u003e\n\nvar nbytes = arr.BYTES_PER_ELEMENT;\n// returns 1\n```\n\n\u003ca name=\"prop-length\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.length\n\nNumber of array elements.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 10\n```\n\n* * *\n\n### Methods\n\n\u003ca name=\"static-method-from\"\u003e\u003c/a\u003e\n\n#### BooleanArray.from( src\\[, clbk\\[, thisArg]] )\n\nCreates a new boolean array from an array-like object or an iterable.\n\n```javascript\nvar arr = BooleanArray.from( [ true, false ] );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 2\n```\n\nTo invoke a function for each `src` value, provide a callback function.\n\n```javascript\nfunction map( v ) {\n    return !v;\n}\n\n// Create a source array:\nvar src = [ true, false ];\n\n// Create a new boolean array by inverting the source array:\nvar arr = BooleanArray.from( src, map );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 2\n\nvar v = arr.get( 0 );\n// returns false\n\nv = arr.get( 1 );\n// returns true\n```\n\nA callback function is provided two arguments:\n\n-   **value**: source value.\n-   **index**: source index.\n\nTo set the callback execution context, provide a `thisArg`.\n\n```javascript\nfunction map( v ) {\n    this.count += 1;\n    return !v;\n}\n\n// Create a source array:\nvar src = [ true, false ];\n\n// Define an execution context:\nvar ctx = {\n    'count': 0\n};\n\n// Create a new boolean array by inverting the source array:\nvar arr = BooleanArray.from( src, map, ctx );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 2\n\nvar n = ctx.count;\n// returns 2\n```\n\n\u003ca name=\"static-method-of\"\u003e\u003c/a\u003e\n\n#### BooleanArray.of( element0\\[, element1\\[, ...elementN]] )\n\nCreates a new boolean array from a variable number of arguments.\n\n```javascript\nvar arr = BooleanArray.of( true, false, false, true );\n// returns \u003cBooleanArray\u003e\n\nvar len = arr.length;\n// returns 4\n```\n\n\u003ca name=\"method-at\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.at( i )\n\nReturns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar v = arr.at( 0 );\n// returns true\n\nv = arr.at( -1 );\n// returns true\n```\n\nIf provided an out-of-bounds index, the method returns `undefined`.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n\nvar v = arr.at( 100 );\n// returns undefined\n\nv = arr.at( -100 );\n// returns undefined\n```\n\n\u003ca name=\"method-copy-within\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.copyWithin( target, start\\[, end] )\n\nCopies a sequence of elements within the array starting at `start` and ending at `end` (non-inclusive) to the position starting at `target`.\n\n```javascript\nvar arr = new BooleanArray( 4 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\narr.set( true, 3 );\n\nvar v = arr.get( 0 );\n// returns true\n\nv = arr.get( 1 );\n// returns false\n\n// Copy the last two elements to the first two elements:\narr.copyWithin( 0, 2 );\n\nv = arr.get( 0 );\n// returns false\n\nv = arr.get( 1 );\n// returns true\n```\n\nBy default, `end` equals the number of array elements (i.e., one more than the last array index). To limit the sequence length, provide an `end` argument.\n\n```javascript\nvar arr = new BooleanArray( 4 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\narr.set( true, 3 );\n\nvar v = arr.get( 2 );\n// returns false\n\nv = arr.get( 3 );\n// returns true\n\n// Copy the first two elements to the last two elements:\narr.copyWithin( 2, 0, 2 );\n\nv = arr.get( 2 );\n// returns true\n\nv = arr.get( 3 );\n// returns false\n```\n\nWhen a `target`, `start`, and/or `end` index is negative, the respective index is determined relative to the last array element. The following example achieves the same behavior as the previous example:\n\n```javascript\nvar arr = new BooleanArray( 4 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\narr.set( true, 3 );\n\nvar v = arr.get( 2 );\n// returns false\n\nv = arr.get( 3 );\n// returns true\n\n// Copy the first two elements to the last two elements using negative indices:\narr.copyWithin( -2, -4, -2 );\n\nv = arr.get( 2 );\n// returns true\n\nv = arr.get( 3 );\n// returns false\n```\n\n\u003ca name=\"method-entries\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.entries()\n\nReturns an iterator for iterating over array key-value pairs.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar it = arr.entries();\n\nvar v = it.next().value;\n// returns [ 0, true ]\n\nv = it.next().value;\n// returns [ 1, false ]\n\nv = it.next().value;\n// returns [ 2, true ]\n\nvar bool = it.next().done;\n// returns true\n```\n\nThe returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties:\n\n-   **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.\n-   **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object.\n\n\u003ca name=\"method-every\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.every( predicate\\[, thisArg] )\n\nReturns a boolean indicating whether all elements pass a test.\n\n```javascript\nfunction predicate( v ) {\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( true, 1 );\narr.set( true, 2 );\n\nvar bool = arr.every( predicate );\n// returns true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v ) {\n    this.count += 1;\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( true, 0 );\narr.set( true, 1 );\narr.set( true, 2 );\n\nvar bool = arr.every( predicate, context );\n// returns true\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-fill\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.fill( value\\[, start\\[, end]] )\n\nReturns a modified typed array filled with a fill value.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\n// Set all elements to the same value:\narr.fill( true );\n\nvar v = arr.get( 0 );\n// returns true\n\nv = arr.get( 1 );\n// returns true\n\nv = arr.get( 2 );\n// returns true\n\n// Fill all elements starting from the second element:\narr.fill( false, 1 );\n\nv = arr.get( 1 );\n// returns false\n\nv = arr.get( 2 );\n// returns false\n\n// Fill all elements from first element until the second-to-last element:\narr.fill( false, 0, 2 );\n\nv = arr.get( 0 );\n// returns false\n\nv = arr.get( 1 );\n// returns false\n```\n\nWhen a `start` and/or `end` index is negative, the respective index is determined relative to the last array element.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\n// Set all array elements, except the last element, to the same value:\narr.fill( true, 0, -1 );\n\nvar v = arr.get( 0 );\n// returns true\n\nv = arr.get( 2 );\n// returns false\n```\n\n\u003ca name=\"method-filter\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.filter( predicate\\[, thisArg] )\n\nReturns a new array containing the elements of an array which pass a test implemented by a predicate function.\n\n```javascript\nfunction predicate( v ) {\n    return ( v === true );\n}\n\nvar arr = new BooleanArray( 3 );\n\n// Set the first three elements:\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.filter( predicate );\n// returns \u003cBooleanArray\u003e\n\nvar len = out.length;\n// returns 2\n\nvar v = out.get( 0 );\n// returns true\n\nv = out.get( 1 );\n// return true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( v === true );\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.filter( predicate, context );\n// returns \u003cBooleanArray\u003e\n\nvar len = out.length;\n// returns 2\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-find\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.find( predicate\\[, thisArg] )\n\nReturns the first element in an array for which a predicate function returns a truthy value.\n\n```javascript\nfunction predicate( v ) {\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar v = arr.find( predicate );\n// returns true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v ) {\n    this.count += 1;\n    return ( v === true );\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( false, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar z = arr.find( predicate, context );\n// returns true\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-find-index\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.findIndex( predicate\\[, thisArg] )\n\nReturns the index of the first element in an array for which a predicate function returns a truthy value.\n\n```javascript\nfunction predicate( v ) {\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar v = arr.findIndex( predicate );\n// returns 0\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v ) {\n    this.count += 1;\n    return ( v === true );\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( false, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar z = arr.findIndex( predicate, context );\n// returns 2\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-find-last\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.findLast( predicate\\[, thisArg] )\n\nReturns the last element in an array for which a predicate function returns a truthy value.\n\n```javascript\nfunction predicate( v ) {\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar v = arr.findLast( predicate );\n// returns true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v ) {\n    this.count += 1;\n    return ( v === true );\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\n\nvar z = arr.findLast( predicate, context );\n// returns true\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-find-last-index\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.findLastIndex( predicate\\[, thisArg] )\n\nReturns the index of the last element in an array for which a predicate function returns a truthy value.\n\n```javascript\nfunction predicate( v ) {\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar v = arr.findLastIndex( predicate );\n// returns 2\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v ) {\n    this.count += 1;\n    return ( v === true );\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\n\nvar z = arr.findLastIndex( predicate, context );\n// returns 0\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-for-each\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.forEach( callbackFn\\[, thisArg] )\n\nInvokes a function once for each array element.\n\n```javascript\nfunction log( v, i ) {\n    console.log( '%s: %s', i.toString(), v.toString() );\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\narr.forEach( log );\n/* =\u003e\n    0: true\n    1: false\n    2: true\n*/\n```\n\nThe invoked function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction fcn( v, i ) {\n    this.count += 1;\n    console.log( '%s: %s', i.toString(), v.toString() );\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\narr.forEach( fcn, context );\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-get\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.get( i )\n\nReturns an array element located at a nonnegative integer position (index) `i`.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n\n// Set the first element:\narr.set( true, 0 );\n\n// Get the first element:\nvar v = arr.get( 0 );\n// returns true\n```\n\nIf provided an out-of-bounds index, the method returns `undefined`.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n\nvar v = arr.get( 100 );\n// returns undefined\n```\n\n\u003ca name=\"includes\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.includes( searchElement\\[, fromIndex] )\n\nReturns a boolean indicating whether an array includes a provided value.\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( true, 3 );\narr.set( true, 4 );\n\nvar bool = arr.includes( true );\n// returns true\n\nbool = arr.includes( false, 2 );\n// returns false\n```\n\n\u003ca name=\"method-index-of\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.indexOf( searchElement\\[, fromIndex] )\n\nReturns the first index at which a given element can be found.\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( true, 3 );\narr.set( true, 4 );\n\nvar idx = arr.indexOf( true );\n// returns 0\n\nidx = arr.indexOf( false, 1 );\n// returns 1\n\nidx = arr.indexOf( true, -3 );\n// returns 2\n```\n\nIf `searchElement` is not present in the array, the method returns `-1`.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( true, 1 );\narr.set( true, 2 );\n\nvar idx = arr.indexOf( false );\n// returns -1\n```\n\n\u003ca name=\"join\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.join( \\[separator] )\n\nReturns a new string by concatenating all array elements.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar str = arr.join();\n// returns 'true,false,true'\n```\n\nBy default, the method separates serialized array elements with a comma. To use an alternative separator, provide a `separator` string.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar str = arr.join( '|' );\n// returns 'true|false|true'\n```\n\n\u003ca name=\"method-keys\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.keys()\n\nReturns an iterator for iterating over each index key in a typed array.\n\n```javascript\nvar arr = new BooleanArray( 2 );\n\narr.set( true, 0 );\narr.set( false, 1 );\n\nvar iter = arr.keys();\n\nvar v = iter.next().value;\n// returns 0\n\nv = iter.next().value;\n// returns 1\n\nvar bool = iter.next().done;\n// returns true\n```\n\nThe returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties:\n\n-   **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.\n-   **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object.\n\n\u003ca name=\"method-last-index-of\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.lastIndexOf( searchElement\\[, fromIndex] )\n\nReturns the last index at which a given element can be found.\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( true, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar idx = arr.lastIndexOf( true );\n// returns 4\n\nidx = arr.lastIndexOf( false, 3 );\n// returns 3\n\nidx = arr.lastIndexOf( true, -3 );\n// returns 2\n```\n\nIf `searchElement` is not present in the array, the method returns `-1`.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( true, 1 );\narr.set( true, 2 );\n\nvar idx = arr.lastIndexOf( false );\n// returns -1\n```\n\n\u003ca name=\"method-map\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.map( callbackFn\\[, thisArg] )\n\nReturns a new array with each element being the result of a provided callback function.\n\n```javascript\nfunction invert( v ) {\n    return !v;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.map( invert );\n// returns \u003cBooleanArray\u003e\n\nvar z = out.get( 0 );\n// returns false\n\nz = out.get( 1 );\n// returns true\n\nz = out.get( 2 );\n// returns false\n```\n\nThe callback function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction invert( v, i ) {\n    this.count += i;\n    return !v;\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.map( invert, context );\n// returns \u003cBooleanArray\u003e\n\nvar count = context.count;\n// returns 3;\n```\n\n\u003ca name=\"method-reduce\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.reduce( reducerFn\\[, initialValue] )\n\nApplies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n\n```javascript\nfunction reducer( acc, v ) {\n    return ( acc \u0026\u0026 v );\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.reduce( reducer );\n// returns false\n```\n\nThe reducer function is provided four arguments:\n\n-   **acc**: accumulated result.\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nBy default, the function initializes the accumulated result to the first element in the array and passes the second array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the first array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument.\n\n```javascript\nfunction reducer( acc, v ) {\n    if ( v ) {\n        return acc + 1;\n    }\n    return acc;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.reduce( reducer, 0 );\n// returns 2\n```\n\n\u003ca name=\"method-reduce-right\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.reduceRight( reducerFn\\[, initialValue] )\n\nApplies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the following element and returning the accumulated result upon completion.\n\n```javascript\nfunction reducer( acc, v ) {\n    return ( acc \u0026\u0026 v );\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.reduceRight( reducer );\n// returns false\n```\n\nThe reducer function is provided four arguments:\n\n-   **acc**: accumulated result.\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nBy default, the function initializes the accumulated result to the last element in the array and passes the second-last array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the last array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument.\n\n```javascript\nfunction reducer( acc, v ) {\n    if ( v ) {\n        return acc + 1;\n    }\n    return acc;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.reduceRight( reducer, 0 );\n// returns 2\n```\n\n\u003ca name=\"method-reverse\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.reverse()\n\nReverses an array in-place.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\n\nvar out = arr.reverse();\n// returns \u003cBooleanArray\u003e\n\nvar v = out.get( 0 );\n// returns false\n\nv = out.get( 1 );\n// returns false\n\nv = out.get( 2 );\n// returns true\n```\n\n\u003ca name=\"method-set\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.set( v\\[, i] )\n\nSets one or more array elements.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n\n// Get the first element:\nvar v = arr.get( 0 );\n// returns false\n\n// Set the first element:\narr.set( true );\n\n// Get the first element:\nv = arr.get( 0 );\n// returns true\n```\n\nBy default, the method sets array elements starting at position (index) `i = 0`. To set elements starting elsewhere in the array, provide an index argument `i`.\n\n```javascript\nvar arr = new BooleanArray( 10 );\n\n// Get the fifth element:\nvar v = arr.get( 4 );\n// returns false\n\n// Set the fifth element:\narr.set( true, 4 );\n\n// Get the fifth element:\nv = arr.get( 4 );\n// returns true\n```\n\nIn addition to providing a single value, to set one or more array elements, provide an array-like object containing truthy and falsy values\n\n```javascript\nvar arr = new BooleanArray( 10 );\n\n// Define an array of values:\nvar buf = [ '', 1, null ];\n\n// Set the fifth, sixth, and seventh elements:\narr.set( buf, 4 );\n\n// Get the sixth element:\nvar v = arr.get( 5 );\n// returns true\n```\n\nA few notes:\n\n-   If `i` is out-of-bounds, the method throws an error.\n-   If a target array cannot accommodate all values (i.e., the length of source array plus `i` exceeds the target array length), the method throws an error.\n-   If provided a [typed array][@stdlib/array/typed] which shares an [`ArrayBuffer`][@stdlib/array/buffer] with the target array, the method will intelligently copy the source range to the destination range.\n\n\u003ca name=\"method-slice\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.slice( \\[start\\[, end]] )\n\nCopies a portion of a typed array to a new typed array.\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar out = arr.slice();\n// returns \u003cBooleanArray\u003e\n\nvar len = out.length;\n// returns 5\n\nvar bool = out.get( 0 );\n// returns true\n\nbool = out.get( len-1 );\n// returns true\n```\n\nBy default, the method returns a typed array beginning with the first array element. To specify an alternative array index at which to begin, provide a `start` index (inclusive).\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar out = arr.slice( 1 );\n// returns \u003cBooleanArray\u003e\n\nvar len = out.length;\n// returns 4\n\nvar bool = out.get( 0 );\n// returns false\n\nbool = out.get( len-1 );\n// returns true\n```\n\nBy default, the method returns a typed array which includes all array elements after `start`. To limit the number of array elements after `start`, provide an `end` index (exclusive).\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar out = arr.slice( 1, -2 );\n// returns \u003cBooleanArray\u003e\n\nvar len = out.length;\n// returns 2\n\nvar bool = out.get( 0 );\n// returns false\n\nbool = out.get( len-1 );\n// returns true\n```\n\n\u003ca name=\"method-some\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.some( predicate\\[, thisArg] )\n\nReturns a boolean indicating whether at least one element passes a test.\n\n```javascript\nfunction predicate( v ) {\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( false, 0 );\narr.set( true, 1 );\narr.set( false, 2 );\n\nvar bool = arr.some( predicate );\n// returns true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v ) {\n    this.count += 1;\n    return v === true;\n}\n\nvar arr = new BooleanArray( 3 );\n\nvar context = {\n    'count': 0\n};\n\narr.set( false, 0 );\narr.set( true, 1 );\narr.set( false, 2 );\n\nvar bool = arr.some( predicate, context );\n// returns true\n\nvar count = context.count;\n// returns 2\n```\n\n\u003ca name=\"method-sort\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.sort( \\[compareFcn] )\n\nSorts an array in-place.\n\n```javascript\nfunction compare( a, b ) {\n    if ( a === false ) {\n        if ( b === false ) {\n            return 0;\n        }\n        return 1;\n    }\n    if ( b === true ) {\n        return 0;\n    }\n    return -1;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\narr.sort( compare );\n\nvar v = arr.get( 0 );\n// returns true\n\nv = arr.get( 1 );\n// returns true\n\nv = arr.get( 2 );\n// returns false\n```\n\nThe `compareFcn` determines the order of the elements. The function is called with the following arguments:\n\n-   **a**: the first boolean value for comparison.\n-   **b**: the second boolean value for comparison.\n\nThe function should return a number where:\n\n-   a negative value indicates that `a` should come before `b`.\n-   a positive value indicates that `a` should come after `b`.\n-   zero or `NaN` indicates that `a` and `b` are considered equal.\n\n\u003ca name=\"method-subarray\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.subarray( \\[begin\\[, end]] )\n\nCreates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host array.\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar subarr = arr.subarray();\n// returns \u003cBooleanArray\u003e\n\nvar len = subarr.length;\n// returns 5\n\nvar bool = subarr.get( 0 );\n// returns true\n\nbool = subarr.get( len-1 );\n// returns true\n```\n\nBy default, the method creates a typed array view beginning with the first array element. To specify an alternative array index at which to begin, provide a `begin` index (inclusive).\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar subarr = arr.subarray( 1 );\n// returns \u003cBooleanArray\u003e\n\nvar len = subarr.length;\n// returns 4\n\nvar bool = subarr.get( 0 );\n// returns false\n\nbool = subarr.get( len-1 );\n// returns true\n```\n\nBy default, the method creates a typed array view which includes all array elements after `begin`. To limit the number of array elements after `begin`, provide an `end` index (exclusive).\n\n```javascript\nvar arr = new BooleanArray( 5 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\narr.set( false, 3 );\narr.set( true, 4 );\n\nvar subarr = arr.subarray( 1, -2 );\n// returns \u003cBooleanArray\u003e\n\nvar len = subarr.length;\n// returns 2\n\nvar bool = subarr.get( 0 );\n// returns false\n\nbool = subarr.get( len-1 );\n// returns true\n```\n\n\u003ca name=\"method-to-locale-string\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.toLocaleString( \\[locales\\[, options]] )\n\nSerializes an array as a locale-specific string.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar str = arr.toLocaleString();\n// returns 'true,false,true'\n```\n\nThe method supports the following arguments:\n\n-   **locales**: a string with a BCP 47 language tag or an array of such strings.\n-   **options**: configuration properties.\n\n\u003ca name=\"method-to-reversed\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.toReversed()\n\nReturns a new typed array containing the elements in reversed order.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( false, 2 );\n\nvar out = arr.toReversed();\n// returns \u003cBooleanArray\u003e\n\nvar v = out.get( 0 );\n// returns false\n\nv = out.get( 1 );\n// returns false\n\nv = out.get( 2 );\n// returns true\n```\n\n\u003ca name=\"method-to-sorted\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.toSorted( \\[compareFcn] )\n\nReturns a new typed array containing the elements in sorted order.\n\n```javascript\nfunction compare( a, b ) {\n    if ( a === false ) {\n        if ( b === false ) {\n            return 0;\n        }\n        return 1;\n    }\n    if ( b === true ) {\n        return 0;\n    }\n    return -1;\n}\n\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar out = arr.sort( compare );\n// returns \u003cBooleanArray\u003e\n\nvar v = out.get( 0 );\n// returns true\n\nv = out.get( 1 );\n// returns true\n\nv = out.get( 2 );\n// returns false\n```\n\nThe `compareFcn` determines the order of the elements. The function is called with the following arguments:\n\n-   **a**: the first boolean value for comparison.\n-   **b**: the second boolean value for comparison.\n\nThe function should return a number where:\n\n-   a negative value indicates that `a` should come before `b`.\n-   a positive value indicates that `a` should come after `b`.\n-   zero or `NaN` indicates that `a` and `b` are considered equal.\n\n\u003ca name=\"method-to-string\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.toString()\n\nSerializes an array as a string.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 2 );\n\nvar str = arr.toString();\n// returns 'true,false,true'\n```\n\n\u003ca name=\"method-values\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.values()\n\nReturns an iterator for iterating over each value in a typed array.\n\n```javascript\nvar arr = new BooleanArray( 2 );\n\narr.set( true, 0 );\narr.set( false, 1 );\n\nvar iter = arr.values();\n\nvar v = iter.next().value;\n// returns true\n\nv = iter.next().value;\n// returns false\n\nvar bool = iter.next().done;\n// returns true\n```\n\nThe returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties:\n\n-   **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.\n-   **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object.\n\n\u003ca name=\"method-with\"\u003e\u003c/a\u003e\n\n#### BooleanArray.prototype.with( index, value )\n\nReturns a new typed array with the element at a provided index replaced with a provided value.\n\n```javascript\nvar arr = new BooleanArray( 3 );\n\narr.set( true, 0 );\narr.set( false, 1 );\narr.set( true, 1 );\n\nvar out = arr.with( 0, false );\n// returns \u003cBooleanArray\u003e\n\nvar v = out.get( 0 );\n// returns false\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.usage --\u003e\n\n\u003c!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"notes\"\u003e\n\n* * *\n\n## Notes\n\n-   While a `BooleanArray` _strives_ to maintain (but does not **guarantee**) consistency with [typed arrays][@stdlib/array/typed], significant deviations from ECMAScript-defined [typed array][@stdlib/array/typed] behavior are as follows:\n\n    -   The constructor does **not** require the `new` operator.\n    -   Accessing array elements using bracket syntax (e.g., `X[i]`) is **not** supported. Instead, one **must** use the `.get()` method.\n\n\u003c/section\u003e\n\n\u003c!-- /.notes --\u003e\n\n\u003c!-- Package usage examples. --\u003e\n\n\u003csection class=\"examples\"\u003e\n\n* * *\n\n## Examples\n\n\u003c!-- eslint no-undef: \"error\" --\u003e\n\n```javascript\nvar Uint8Array = require( '@stdlib/array-uint8' );\nvar logEach = require( '@stdlib/console-log-each' );\nvar BooleanArray = require( '@stdlib/array-bool' );\n\n// Create a boolean array by specifying a length:\nvar out = new BooleanArray( 3 );\nlogEach( '%s', out );\n\n// Create a boolean array from an array of booleans:\nvar arr = [ true, false, true ];\nout = new BooleanArray( arr );\nlogEach( '%s', out );\n\n// Create a boolean array from an array buffer:\narr = new Uint8Array( [ 1, 0, 1, 1, 0, 1 ] );\nout = new BooleanArray( arr.buffer );\nlogEach( '%s', out );\n\n// Create a boolean array from an array buffer view:\narr = new Uint8Array( [ 1, 0, 1, 1, 0, 1 ] );\nout = new BooleanArray( arr.buffer, 1, 2 );\nlogEach( '%s', out );\n\nconsole.log( '%s', false );\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.examples --\u003e\n\n\u003c!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"references\"\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.references --\u003e\n\n\u003c!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --\u003e\n\n\u003csection class=\"related\"\u003e\n\n* * *\n\n## See Also\n\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/array-buffer`][@stdlib/array/buffer]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003eArrayBuffer.\u003c/span\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.related --\u003e\n\n\u003c!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\n\u003csection class=\"main-repo\" \u003e\n\n* * *\n\n## Notice\n\nThis package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.\n\nFor more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].\n\n#### Community\n\n[![Chat][chat-image]][chat-url]\n\n---\n\n## License\n\nSee [LICENSE][stdlib-license].\n\n\n## Copyright\n\nCopyright \u0026copy; 2016-2025. The Stdlib [Authors][stdlib-authors].\n\n\u003c/section\u003e\n\n\u003c!-- /.stdlib --\u003e\n\n\u003c!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"links\"\u003e\n\n[npm-image]: http://img.shields.io/npm/v/@stdlib/array-bool.svg\n[npm-url]: https://npmjs.org/package/@stdlib/array-bool\n\n[test-image]: https://github.com/stdlib-js/array-bool/actions/workflows/test.yml/badge.svg?branch=main\n[test-url]: https://github.com/stdlib-js/array-bool/actions/workflows/test.yml?query=branch:main\n\n[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-bool/main.svg\n[coverage-url]: https://codecov.io/github/stdlib-js/array-bool?branch=main\n\n\u003c!--\n\n[dependencies-image]: https://img.shields.io/david/stdlib-js/array-bool.svg\n[dependencies-url]: https://david-dm.org/stdlib-js/array-bool/main\n\n--\u003e\n\n[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg\n[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im\n\n[stdlib]: https://github.com/stdlib-js/stdlib\n\n[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors\n\n[umd]: https://github.com/umdjs/umd\n[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules\n\n[deno-url]: https://github.com/stdlib-js/array-bool/tree/deno\n[deno-readme]: https://github.com/stdlib-js/array-bool/blob/deno/README.md\n[umd-url]: https://github.com/stdlib-js/array-bool/tree/umd\n[umd-readme]: https://github.com/stdlib-js/array-bool/blob/umd/README.md\n[esm-url]: https://github.com/stdlib-js/array-bool/tree/esm\n[esm-readme]: https://github.com/stdlib-js/array-bool/blob/esm/README.md\n[branches-url]: https://github.com/stdlib-js/array-bool/blob/main/branches.md\n\n[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-bool/main/LICENSE\n\n[mdn-iterator-protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol\n\n[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed\n\n[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer\n\n\u003c/section\u003e\n\n\u003c!-- /.links --\u003e\n","funding_links":["https://github.com/sponsors/stdlib-js","https://opencollective.com/stdlib","https://tidelift.com/funding/github/npm/@stdlib/stdlib"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdlib-js%2Farray-bool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdlib-js%2Farray-bool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdlib-js%2Farray-bool/lists"}