With:
const myArray = [0,4,2];
myArray.at(-1);
I get the following error under .at
Property 'at' does not exist on type 'number[]'.ts (2339)
What's going on here why doesn't Array.at() work? Do I have to set some sort of browserlist value to let TS know that I want to be able to use this (recently spec'd) feature?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at
Here's my tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}