Value.typed_array


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "2.38" ) ]
public Value.typed_array (Context context, TypedArrayType type, size_t length)

Create a new typed array containing a given amount of elements.

Create a Value referencing a new typed array with space for length elements of a given type. As all typed arrays must have an associated `ArrayBuffer`, a new one of suitable size will be allocated to store the elements, which will be initialized to zero.

The type must *not* be jsc_typed_array_none.

Parameters:

context

a Context

type

the type of array elements

length

number of elements in the array

Returns:

a Value