Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pankaj-bind opened this issue May 9, 2024 · 0 comments

Comments

@pankaj-bind
Copy link

pankaj-bind commented May 9, 2024

@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]

@pankaj-bind pankaj-bind changed the title Compiler is not supporting TypedArray.prototype.toSorted() and TypedArray.prototype.wiith() method Compiler have no support for TypedArray.prototype.toSorted() and TypedArray.prototype.wiith() method Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant