Extremely strange TS behaviour someone just DM'd me.

Adding | [] to a generic type parameter seems to infer the type as a tuple, instead of an array!

Pretty weird, and quite useful to know about!

Source: x.com/mattpocockuk/status/1834627340329951251

Reply to this note

Please Login to reply.

Discussion

No replies yet.