Gathering detailed insights and metrics for @stdlib/array-uint32
Gathering detailed insights and metrics for @stdlib/array-uint32
npm install @stdlib/array-uint32
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
95.5
Quality
82.9
Maintenance
100
Vulnerability
88
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
62,080,716
Last Day
80,593
Last Week
343,060
Last Month
1,519,015
Last Year
26,946,213
1 Stars
65 Commits
3 Watching
5 Branches
11 Contributors
Minified
Minified + Gzipped
Latest Version
0.2.2
Package Id
@stdlib/array-uint32@0.2.2
Unpacked Size
56.25 kB
Size
12.15 kB
File Count
12
NPM Version
8.19.4
Node Version
16.20.2
Publised On
27 Jul 2024
Cumulative downloads
Total Downloads
Last day
-6.3%
80,593
Compared to previous day
Last week
-13.5%
343,060
Compared to previous week
Last month
9.1%
1,519,015
Compared to previous month
Last year
1.1%
26,946,213
Compared to previous year
1
We 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.
The 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.
When 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.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.
1npm install @stdlib/array-uint32
1var Uint32Array = require( '@stdlib/array-uint32' );
A typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.
1var arr = new Uint32Array(); 2// returns <Uint32Array>
Returns a typed array having a specified length.
1var arr = new Uint32Array( 5 ); 2// returns <Uint32Array>[ 0, 0, 0, 0, 0 ]
Creates a typed array from another typed array.
1var Float32Array = require( '@stdlib/array-float32' ); 2 3var arr1 = new Float32Array( [ 5.0, 5.0, 5.0 ] ); 4var arr2 = new Uint32Array( arr1 ); 5// returns <Uint32Array>[ 5, 5, 5 ]
Creates a typed array from an array-like object
or iterable.
1var arr = new Uint32Array( [ 5.0, 5.0, 5.0 ] ); 2// returns <Uint32Array>[ 5, 5, 5 ]
Returns a typed array view of an ArrayBuffer
.
1var ArrayBuffer = require( '@stdlib/array-buffer' ); 2 3var buf = new ArrayBuffer( 16 ); 4var arr = new Uint32Array( buf, 0, 4 ); 5// returns <Uint32Array>[ 0, 0, 0, 0 ]
Number of bytes per view element.
1var nbytes = Uint32Array.BYTES_PER_ELEMENT; 2// returns 4
Typed array constructor name.
1var str = Uint32Array.name; 2// returns 'Uint32Array'
Read-only property which returns the ArrayBuffer
referenced by the typed array.
1var arr = new Uint32Array( 5 ); 2var buf = arr.buffer; 3// returns <ArrayBuffer>
Read-only property which returns the length (in bytes) of the typed array.
1var arr = new Uint32Array( 5 ); 2var byteLength = arr.byteLength; 3// returns 20
Read-only property which returns the offset (in bytes) of the typed array from the start of its ArrayBuffer
.
1var arr = new Uint32Array( 5 ); 2var byteOffset = arr.byteOffset; 3// returns 0
Number of bytes per view element.
1var arr = new Uint32Array( 5 ); 2var nbytes = arr.BYTES_PER_ELEMENT; 3// returns 4
Read-only property which returns the number of view elements.
1var arr = new Uint32Array( 5 ); 2var len = arr.length; 3// returns 5
Creates a new typed array from an array-like object
or an iterable.
1var arr = Uint32Array.from( [ 1, 2 ] ); 2// returns <Uint32Array>[ 1, 2 ]
To invoke a function for each src
value, provide a callback function.
1function mapFcn( v ) { 2 return v * 2; 3} 4 5var arr = Uint32Array.from( [ 1, 2 ], mapFcn ); 6// returns <Uint32Array>[ 2, 4 ]
A callback function is provided two arguments:
value
: source valueindex
: source indexTo set the callback execution context, provide a thisArg
.
1function mapFcn( v ) { 2 this.count += 1; 3 return v * 2; 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr = Uint32Array.from( [ 1, 2 ], mapFcn, ctx ); 11// returns <Uint32Array>[ 2, 4 ] 12 13var n = ctx.count; 14// returns 2
Creates a new typed array from a variable number of arguments.
1var arr = Uint32Array.of( 1, 2 ); 2// returns <Uint32Array>[ 1, 2 ]
Copies a sequence of elements within an array starting at start
and ending at end
(non-inclusive) to the position starting at target
.
1var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); 2 3// Copy the last two elements to the first two elements: 4arr.copyWithin( 0, 3 ); 5 6var v = arr[ 0 ]; 7// returns 4 8 9v = arr[ 1 ]; 10// returns 5
By 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.
1var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); 2 3// Copy the first two elements to the last two elements: 4arr.copyWithin( 3, 0, 2 ); 5 6var v = arr[ 3 ]; 7// returns 1 8 9v = arr[ 4 ]; 10// returns 2
When 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:
1var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] ); 2 3// Copy the first two elements to the last two elements: 4arr.copyWithin( -2, -5, -3 ); 5 6var v = arr[ 3 ]; 7// returns 1 8 9v = arr[ 4 ]; 10// returns 2
Returns an iterator for iterating over array key-value pairs.
1var arr = new Uint32Array( [ 1, 2 ] ); 2 3// Create an iterator: 4var it = arr.entries(); 5 6// Iterate over key-value pairs... 7var v = it.next().value; 8// returns [ 0, 1 ] 9 10v = it.next().value; 11// returns [ 1, 2 ] 12 13var bool = it.next().done; 14// returns true
Tests whether all array elements pass a test implemented by a predicate
function.
1function predicate( v ) { 2 return ( v <= 1 ); 3} 4 5var arr = new Uint32Array( [ 1, 2 ] ); 6 7var bool = arr.every( predicate ); 8// returns false
A predicate
function is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function predicate( v ) { 2 this.count += 1; 3 return ( v >= 1 ); 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr = new Uint32Array( [ 1, 2 ] ); 11 12var bool = arr.every( predicate, ctx ); 13// returns true 14 15var n = ctx.count; 16// returns 2
Fills an array from a start
index to an end
index (non-inclusive) with a provided value
.
1var arr = new Uint32Array( 2 ); 2 3// Set all array elements to the same value: 4arr.fill( 2 ); 5 6var v = arr[ 0 ]; 7// returns 2 8 9v = arr[ 1 ]; 10// returns 2 11 12// Set all array elements starting from the first index to the same value: 13arr.fill( 3, 1 ); 14 15v = arr[ 0 ]; 16// returns 2 17 18v = arr[ 1 ]; 19// returns 3 20 21// Set all array elements, except the last element, to the same value: 22arr.fill( 4, 0, arr.length-1 ); 23 24v = arr[ 0 ]; 25// returns 4 26 27v = arr[ 1 ]; 28// returns 3
When a start
and/or end
index is negative, the respective index is determined relative to the last array element.
1var arr = new Uint32Array( 2 ); 2 3// Set all array elements, except the last element, to the same value: 4arr.fill( 2, -arr.length, -1 ); 5 6var v = arr[ 0 ]; 7// returns 2 8 9v = arr[ 1 ]; 10// returns 0
Creates a new array (of the same data type as the host array) which includes those elements for which a predicate
function returns a truthy value.
1function predicate( v ) { 2 return ( v >= 2 ); 3} 4 5var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 6 7var arr2 = arr1.filter( predicate ); 8// returns <Uint32Array>[ 2, 3 ]
If a predicate
function does not return a truthy value for any array element, the method returns an empty array.
1function predicate( v ) { 2 return ( v >= 10 ); 3} 4 5var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 6 7var arr2 = arr1.filter( predicate ); 8// returns <Uint32Array>[]
A predicate
function is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function predicate( v ) { 2 this.count += 1; 3 return ( v >= 2 ); 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 11 12var arr2 = arr1.filter( predicate, ctx ); 13 14var n = ctx.count; 15// returns 3
Returns the first array element for which a provided predicate
function returns a truthy value.
1function predicate( v ) { 2 return ( v > 2 ); 3} 4 5var arr = new Uint32Array( [ 1, 2, 3 ] ); 6 7var v = arr.find( predicate ); 8// returns 3
If a predicate
function does not return a truthy value for any array element, the method returns undefined
.
1function predicate( v ) { 2 return ( v < 1 ); 3} 4 5var arr = new Uint32Array( [ 1, 2, 3 ] ); 6 7var v = arr.find( predicate ); 8// returns undefined
A predicate
function is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function predicate( v ) { 2 this.count += 1; 3 return ( v > 2 ); 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr = new Uint32Array( [ 1, 2, 3 ] ); 11 12var v = arr.find( predicate, ctx ); 13// returns 3 14 15var n = ctx.count; 16// returns 3
Returns the index of the first array element for which a provided predicate
function returns a truthy value.
1function predicate( v ) { 2 return ( v >= 3 ); 3} 4 5var arr = new Uint32Array( [ 1, 2, 3 ] ); 6 7var idx = arr.findIndex( predicate ); 8// returns 2
If a predicate
function does not return a truthy value for any array element, the method returns -1
.
1function predicate( v ) { 2 return ( v < 1 ); 3} 4 5var arr = new Uint32Array( [ 1, 2, 3 ] ); 6 7var idx = arr.findIndex( predicate ); 8// returns -1
A predicate
function is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function predicate( v ) { 2 this.count += 1; 3 return ( v >= 3 ); 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr = new Uint32Array( [ 1, 2, 3 ] ); 11 12var idx = arr.findIndex( predicate, ctx ); 13// returns 2 14 15var n = ctx.count; 16// returns 3
Invokes a callback for each array element.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var str = ''; 4 5function fcn( v, i ) { 6 str += i + ':' + v; 7 if ( i < arr.length-1 ) { 8 str += ' '; 9 } 10} 11 12arr.forEach( fcn ); 13 14console.log( str ); 15// => '0:1 1:2 2:3'
The callback is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function fcn() { 2 this.count += 1; 3} 4 5var ctx = { 6 'count': 0 7}; 8 9var arr = new Uint32Array( [ 1, 2, 3 ] ); 10 11arr.forEach( fcn, ctx ); 12 13var n = ctx.count; 14// returns 3
Returns a boolean
indicating whether an array includes a search element.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var bool = arr.includes( 3 ); 4// returns true 5 6bool = arr.includes( 0 ); 7// returns false
By default, the method searches the entire array (fromIndex = 0
). To begin searching from a specific array index, provide a fromIndex
.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var bool = arr.includes( 1, 1 ); 4// returns false
When a fromIndex
is negative, the starting index is resolved relative to the last array element.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var bool = arr.includes( 1, -2 ); 4// returns false
Returns the index of the first array element strictly equal to a search element.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var idx = arr.indexOf( 3 ); 4// returns 2 5 6idx = arr.indexOf( 0 ); 7// returns -1
By default, the method searches the entire array (fromIndex = 0
). To begin searching from a specific array index, provide a fromIndex
.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var idx = arr.indexOf( 1, 1 ); 4// returns -1
When a fromIndex
is negative, the starting index is resolved relative to the last array element.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var idx = arr.indexOf( 1, -2 ); 4// returns -1
Serializes an array by joining all array elements as a string.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var str = arr.join(); 4// returns '1,2,3'
By default, the method delineates array elements using a comma ,
. To specify a custom separator, provide a separator
string.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var str = arr.join( '|' ); 4// returns '1|2|3'
Returns an iterator for iterating over array keys.
1var arr = new Uint32Array( [ 1, 2 ] ); 2 3// Create an iterator: 4var it = arr.keys(); 5 6// Iterate over keys... 7var v = it.next().value; 8// returns 0 9 10v = it.next().value; 11// returns 1 12 13var bool = it.next().done; 14// returns true
Returns the index of the last array element strictly equal to a search element, iterating from right to left.
1var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); 2 3var idx = arr.lastIndexOf( 0 ); 4// returns 3 5 6idx = arr.lastIndexOf( 3 ); 7// returns -1
By default, the method searches the entire array (fromIndex = -1
). To begin searching from a specific array index, provide a fromIndex
.
1var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); 2 3var idx = arr.lastIndexOf( 0, 2 ); 4// returns 1
When a fromIndex
is negative, the starting index is resolved relative to the last array element.
1var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] ); 2 3var idx = arr.lastIndexOf( 0, -3 ); 4// returns 1
Maps each array element to an element in a new array having the same data type as the host array.
1function fcn( v ) { 2 return v * 2; 3} 4 5var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 6 7var arr2 = arr1.map( fcn ); 8// returns <Uint32Array>[ 2, 4, 6 ]
A callback is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function fcn( v ) { 2 this.count += 1; 3 return v * 2; 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 11 12var arr2 = arr1.map( fcn, ctx ); 13 14var n = ctx.count; 15// returns 3
Applies a function against an accumulator and each element in an array and returns the accumulated result.
1function fcn( acc, v ) { 2 return acc + ( v*v ); 3} 4 5var arr = new Uint32Array( [ 2, 1, 3 ] ); 6 7var v = arr.reduce( fcn ); 8// returns 12
If not provided an initial value, the method invokes a provided function with the first array element as the first argument and the second array element as the second argument.
If provided an initial value, the method invokes a provided function with the initial value as the first argument and the first array element as the second argument.
1function fcn( acc, v ) { 2 return acc + ( v*v ); 3} 4 5var arr = new Uint32Array( [ 2, 1, 3 ] ); 6 7var v = arr.reduce( fcn, 0 ); 8// returns 14
A callback is provided four arguments:
acc
: accumulated resultvalue
: array elementindex
: array indexarr
: array on which the method is invokedApplies a function against an accumulator and each element in an array and returns the accumulated result, iterating from right to left.
1function fcn( acc, v ) { 2 return acc + ( v*v ); 3} 4 5var arr = new Uint32Array( [ 2, 1, 3 ] ); 6 7var v = arr.reduceRight( fcn ); 8// returns 8
If not provided an initial value, the method invokes a provided function with the last array element as the first argument and the second-to-last array element as the second argument.
If provided an initial value, the method invokes a provided function with the initial value as the first argument and the last array element as the second argument.
1function fcn( acc, v ) { 2 return acc + ( v*v ); 3} 4 5var arr = new Uint32Array( [ 2, 1, 3 ] ); 6 7var v = arr.reduce( fcn, 0 ); 8// returns 14
A callback is provided four arguments:
acc
: accumulated resultvalue
: array elementindex
: array indexarr
: array on which the method is invokedReverses an array in-place (thus mutating the array on which the method is invoked).
1var arr = new Uint32Array( [ 2, 0, 3 ] ); 2 3// Reverse the array: 4arr.reverse(); 5 6var v = arr[ 0 ]; 7// returns 3 8 9v = arr[ 1 ]; 10// returns 0 11 12v = arr[ 2 ]; 13// returns 2
Sets array elements.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2// returns <Uint32Array>[ 1, 2, 3 ] 3 4// Set the first two array elements: 5arr.set( [ 4, 5 ] ); 6 7var v = arr[ 0 ]; 8// returns 4 9 10v = arr[ 1 ]; 11// returns 5
By default, the method starts writing values at the first array index. To specify an alternative index, provide an index offset
.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2// returns <Uint32Array>[ 1, 2, 3 ] 3 4// Set the last two array elements: 5arr.set( [ 4, 5 ], 1 ); 6 7var v = arr[ 1 ]; 8// returns 4 9 10v = arr[ 2 ]; 11// returns 5
Copies array elements to a new array with the same underlying data type as the host array.
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.slice(); 4 5var bool = ( arr1 === arr2 ); 6// returns false 7 8bool = ( arr1.buffer === arr2.buffer ); 9// returns false 10 11var v = arr2[ 0 ]; 12// returns 1 13 14v = arr2[ 1 ]; 15// returns 2 16 17v = arr2[ 2 ]; 18// returns 3
By default, the method copies elements beginning with the first array element. To specify an alternative array index at which to begin copying, provide a begin
index (inclusive).
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.slice( 1 ); 4 5var len = arr2.length; 6// returns 2 7 8var v = arr2[ 0 ]; 9// returns 2 10 11v = arr2[ 1 ]; 12// returns 3
By default, the method copies all array elements after begin
. To specify an alternative array index at which to end copying, provide an end
index (exclusive).
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.slice( 0, 2 ); 4 5var len = arr2.length; 6// returns 2 7 8var v = arr2[ 0 ]; 9// returns 1 10 11v = arr2[ 1 ]; 12// returns 2
When a begin
and/or end
index is negative, the respective index is determined relative to the last array element.
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.slice( -arr1.length, -1 ); 4 5var len = arr2.length; 6// returns 2 7 8var v = arr2[ 0 ]; 9// returns 1 10 11v = arr2[ 1 ]; 12// returns 2
Tests whether at least one array element passes a test implemented by a predicate
function.
1function predicate( v ) { 2 return ( v >= 2 ); 3} 4 5var arr = new Uint32Array( [ 1, 2 ] ); 6 7var bool = arr.some( predicate ); 8// returns true
A predicate
function is provided three arguments:
value
: array elementindex
: array indexarr
: array on which the method is invokedTo set the callback execution context, provide a thisArg
.
1function predicate( v ) { 2 this.count += 1; 3 return ( v >= 2 ); 4} 5 6var ctx = { 7 'count': 0 8}; 9 10var arr = new Uint32Array( [ 1, 1 ] ); 11 12var bool = arr.some( predicate, ctx ); 13// returns false 14 15var n = ctx.count; 16// returns 2
Sorts an array in-place (thus mutating the array on which the method is invoked).
1var arr = new Uint32Array( [ 2, 3, 0 ] ); 2 3// Sort the array (in ascending order): 4arr.sort(); 5 6var v = arr[ 0 ]; 7// returns 0 8 9v = arr[ 1 ]; 10// returns 2 11 12v = arr[ 2 ]; 13// returns 3
By default, the method sorts array elements in ascending order. To impose a custom order, provide a compareFunction
.
1function descending( a, b ) { 2 return b - a; 3} 4 5var arr = new Uint32Array( [ 2, 3, 0 ] ); 6 7// Sort the array (in descending order): 8arr.sort( descending ); 9 10var v = arr[ 0 ]; 11// returns 3 12 13v = arr[ 1 ]; 14// returns 2 15 16v = arr[ 2 ]; 17// returns 0
The comparison function is provided two array elements, a
and b
, per invocation, and its return value determines the sort order as follows:
a
to an index lower than b
(i.e., a
should come before b
).a
to an index higher than b
(i.e., b
should come before a
).a
and b
should remain unchanged.Creates a new typed array view over the same underlying ArrayBuffer
and with the same underlying data type as the host array.
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.subarray(); 4// returns <Uint32Array>[ 1, 2, 3 ] 5 6var bool = ( arr1.buffer === arr2.buffer ); 7// returns true
By 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).
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.subarray( 1 ); 4// returns <Uint32Array>[ 2, 3 ] 5 6var bool = ( arr1.buffer === arr2.buffer ); 7// returns true
By 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).
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.subarray( 0, 2 ); 4// returns <Uint32Array>[ 1, 2 ] 5 6var bool = ( arr1.buffer === arr2.buffer ); 7// returns true
When a begin
and/or end
index is negative, the respective index is determined relative to the last array element.
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.subarray( -arr1.length, -1 ); 4// returns <Uint32Array>[ 1, 2 ] 5 6var bool = ( arr1.buffer === arr2.buffer ); 7// returns true
If the method is unable to resolve indices to a non-empty array subsequence, the method returns an empty typed array.
1var arr1 = new Uint32Array( [ 1, 2, 3 ] ); 2 3var arr2 = arr1.subarray( 10, -1 ); 4// returns <Uint32Array>[]
Serializes an array as a locale-specific string
.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var str = arr.toLocaleString(); 4// returns '1,2,3'
Serializes an array as a string
.
1var arr = new Uint32Array( [ 1, 2, 3 ] ); 2 3var str = arr.toString(); 4// returns '1,2,3'
Returns an iterator for iterating over array elements.
1var arr = new Uint32Array( [ 1, 2 ] ); 2 3// Create an iterator: 4var it = arr.values(); 5 6// Iterate over array elements... 7var v = it.next().value; 8// returns 1 9 10v = it.next().value; 11// returns 2 12 13var bool = it.next().done; 14// returns true
1var randu = require( '@stdlib/random-base-randu' ); 2var round = require( '@stdlib/math-base-special-round' ); 3var ctor = require( '@stdlib/array-uint32' ); 4 5var arr; 6var i; 7 8arr = new ctor( 10 ); 9for ( i = 0; i < arr.length; i++ ) { 10 arr[ i ] = round( randu()*100.0 ); 11} 12console.log( arr );
@stdlib/array-buffer
: ArrayBuffer.@stdlib/array-float32
: Float32Array.@stdlib/array-float64
: Float64Array.@stdlib/array-int16
: Int16Array.@stdlib/array-int32
: Int32Array.@stdlib/array-int8
: Int8Array.@stdlib/array-uint16
: Uint16Array.@stdlib/array-uint8
: Uint8Array.@stdlib/array-uint8c
: Uint8ClampedArray.This package is part of 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.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2024. The Stdlib Authors.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More