I am encountering an issue while experimenting with the latest JavaScript array methods in Quokka.js within Visual Studio Code. I'm trying to use the following new array methods: toSorted()
, toReserved()
, with()
, and toSpliced()
.
However, I'm consistently getting an error, and I'm not sure how to resolve it. The error message is as follows:
numbers.toSorted is not a function
Here is a snippet of the code I am using:
let numbers = [5, 4, 1, 2, 3];
let result = numbers.toSorted();
console.log(numbers);
console.log(result);
I would appreciate any guidance on how to address this error and successfully use these new array methods in Quokka.js.