I like the tricks :) – Kasia
Increase type-safety with `noUncheckedIndexedAccess`, which is not included in `strict`.
// tsconfig.json // "strict": true declare const xs: number[] const index = xs[xs.length - 1] // ^? ⛔️ number const at = xs.at(-1) // ^? ✅ number | undefined
// tsconfig.json // "noUncheckedIndexedAccess": true declare const xs: number[] const index = xs[xs.length - 1] // ^? ✅ number | undefined const at = xs.at(-1) // ^? ✅ number | undefined
Crafted with 💛 by Riccardo