Can someone tell me what the `!` on array indexes ...
# random
d
Can someone tell me what the
!
on array indexes does? cant get any information without knowing the "name" of these thing.. i.E: https://github.com/prisma/graphql-request/blob/b0abe80788741f6360c7cd2cbc37620c573be0b1/src/types.ts#L60
l
it's a way of telling to Typescript that the prop can't be undefined
in that case Typescript may say that
response.errors[0].message
is not valid because
errors
may be undefined, but if you are sure that's not the case then you can add the
!
d
hmm thx, never seen before. didnt even know, you can tell typescript these, without declare own variable. nice to know