hl,
@hl@social.lol avatar

@sarajw This seemed to be what I needed to convince the checker that a variable was not undefined when it was in an if statement that checked exactly that, but the checker didn't realise: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#non-null-assertion-operator-postfix-

Does seem like cheating though. #TypeScript

sarajw,
@sarajw@front-end.social avatar

@hl Thank you!

hl,
@hl@social.lol avatar

@sarajw Writing it does feel a bit like you're shouting the variable name at the checker, as if it's hard of hearing: "No, I said variable X is none Null, not 'Ron Full', NONE NULL!"

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • JUstTest
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • megavids
  • lostlight
  • All magazines