JavaScript Float32Array : ArrayBufferView
Array
where each item is a 32 bit (4 byte)
floating point number. Float32Arrays cannot change size after creation.
Constructors
Creates a new Float32Array
of the specified length where each item starts out as 0
Example:
RunResults:
Creates a new Float32Array
and copies the items of array
into this
. The
copied items are converted to 32 bit floats before being stored in this
.
Example:
RunResults:
Creates a new Float32Array
and copies the items of array
into this
.
array
can be any of the typed array types and the copied items will be converted to 32 bit floats
before being stored in this
.
Example:
RunResults:
Creates a view on top of the specified buffer
starting at byteOffset
of
length
items. Changes to the items in this
actual affect the underlying
buffer
, and vice versa. byteOffset
must be a multiple of 4. (Use DataView
for unaligned data.) If length
is not specified,
buffer.length - byteOffset
must be a multiple of 4 and this.length
will be
(buffer.length - byteOffset) / 4
.
Example:
RunResults:
Instance Indexers
Gets and sets the element in this
at index
. index
should be between
0
and this.length - 1
.
Example:
RunResults:
Instance Methods
Copies this[start]
, this[start + 1]
, ... this[end - 1]
to
this[target]
, this[target + 1]
, ... If end
is not specified,
this.length
is used.
Example:
RunResults:
Returns true
if callback
returns true
for every item in this
.
Otherwise returns false
. The Float32Array
passed to callback
is the
this
of the call to every
.
Example:
RunResults:
Fills this[start]
, this[start + 1]
, ... this[end - 1]
with
value
. If end
is not specified, this.length
is used. Returns
this
.
Example:
RunResults:
Returns a new Float32Array
containing only the items in this
that callback
returned true
for. The Float32Array
passed to callback
is the
this
of the call to filter
.
Example:
RunResults:
Returns the first item in this
where callback
returns true
for that item.
The Float32Array
passed to callback
is the this
of the call to
find
. See also findIndex()
.
Example:
RunResults:
Calls callback
for each item in this
. The Float32Array
passed to
callback
is the this
of the call to forEach
.
Example:
RunResults:
Returns true
if item
is an element of this
starting the search from
startingIndex
. If startingIndex
is negative, this.length
is added to it
before starting the search.
Example:
RunResults:
Returns the first location of item
in this
starting the search from start
.
If startingIndex
is negative, this.length
is added to it before starting the search.
Returns -1
if item
is not found. See also lastIndexOf()
.
Example:
RunResults:
Returns a String created by joining the toString()
of each item of this
separated by
separator
.
Example:
RunResults:
Returns the location of item
by searchig backwards through this
, starting the search
from startingIndex
. If startingIndex
is not specified, the search starts from the end of
the array. If startingIndex
is negative, this.length
is added to it before starting the
search. Returns -1
if item
is not found. See also indexOf()
.
Example:
RunResults:
Returns a new Float32Array
with where each item is the result of calling callback
on
each item in this
. The Float32Array
passed to callback
is the
this
of the call to map
.
Example:
RunResults:
Calls callback
for each item in this
in ascending order (0
to
length-1
). It passes the return value of callback
for the i-1
th item as the
previous
parameter for the i
th item. Returns the result from the last call to
callback
. If initialValue
is not specified, callback
will first be called
on this[1]
with previous
set to this[0]
. The Float32Array
passed to callback
is the this
of the call to reduce
.
Example:
RunResults:
Calls callback
for each item in this
in descending order (length-1
to
0
). It passes the return value of callback
for the i+1
th item as the
previous
parameter for the i
th item. Returns the result from the last call to
callback
. If initialValue
is not specified, callback
will first be called
on this[this.length - 2]
with previous
set to this[this.length - 1]
. The
Float32Array
passed to callback
is the this
of the call to
reduceRight
.
Example:
RunResults:
Reverses the order of the items in this
and returns this
.
Example:
RunResults:
Copies items from array
into this
starting at this[offset]
. Copied
items are converted to 32 bit floats before storing in this
.
Example:
RunResults:
Copies items from array
into this
starting at this[offset]
.
array
can be any of the typed array types and the copied items will be converted to 32 bit floats
before storing in this
.
Example:
RunResults:
Returns a new Float32Array
which is composed of the items
this[start], this[start + 1], ..., this[end - 1]
. Note that item[end]
is not included.
If start
or end
is negative, the value is added to this.length
before
performing the slice. If end
is not specified, this.length
is used.
Example:
RunResults:
Returns true
if callback
returns true
for at least one item in
this
. Otherwise returns false
. The Float32Array
passed to
callback
is the this
of the call to some
.
Example:
RunResults:
Sort the items of this
using comparisonFunction
to determine the sort order and returns
this
. The Number returned by comparisonFunction
should be 0
if
x
and y
are equal, negative if x
is less than y
, or positive
if x
is greater than y
. If comparisonFunction
is not specified, the items
will be sorted in numeric order. Returns this
.
Example:
RunResults:
Returns a new Float32Array that is a view on top of this
containing items this[begin]
,
this[begin + 1]
, ..., this[end - 1]
. The 0th item in the returned array in the same
memory location as this[begin]
. If end
is not specified, this.length
is
used.