by jankovicsandras · 3y ago · 0 comments
This is wrong. Array.at can get, but not set the value. So they're not equivalent.
console.log( arr[arr.length-1] ); // works
arr[arr.length-1] = 1; // works
console.log( arr.at(-1) ); // works
arr.at(-1) = 1; // ReferenceError: Invalid left-hand side in assignment