I know the double negation prefix, and I know TypeScript's single postfix (non-null assertion).
But what is this double postfix exclamation mark?
/.*verification code is (\d{6}).*/.exec(email.body!!)!![1]
Taken from here.
It's similar to how !! works in JavaScript, except pointless.
! asserts that the previous expression is non-nullish.
! can be used after expressions.
expression! asserts that expression is non-nullish.
expression!! asserts that expression! is non-nullish.
A single ! suffices, but more are not syntactically prohibited. The following is valid too:
/.*verification code is (\d{6}).*/.exec(email.body!!!!!!)!!!![1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With