Skip to content

Compiler have no support for TypedArray.prototype.toSorted() and TypedArray.prototype.wiith() method #7

@pankaj-bind

Description

@pankaj-bind

@the reason is the NodeJS version you are currently using. The methods are newly introduced and the version you are using does not support yet.

Here is the example code snippet of these two methods
// TypedArray.prototype.toSorted()
const numbers = new Int16Array([5, 1, 8, 3, 2]);
const sortedNumbers = numbers.toSorted();
console.log(sortedNumbers); // Output: Int16Array(5) [1, 2, 3, 5, 8]
console.log(numbers); // Output: Int16Array(5) [5, 1, 8, 3, 2]

// TypedArray.prototype.with()
const numbers = new Int8Array([1, 3, 5, 7, 9]);
const modifiedNumbers = numbers.with(2, 10);
console.log(numbers); // Output: Int8Array(5) [1, 3, 5, 7, 9] (original remains unchanged)
console.log(modifiedNumbers); // Output: Int8Array(5) [1, 3, 10, 7, 9]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions