Typescript array typing
Hey I was wondering why typescript doesn't indicate that the
name
here is possibly undefined when the arr is empty?
5 Replies
depends on your tsconfig
this might help https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess
TSConfig Reference - Docs on every TSConfig option
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
Thats what I thought
Strange that default create next app doesnt have this option turned on
Thanks
create next app has a history of not being great at ts by default
They are improving. Just by having TS as default, I'll take that W 😆