HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-23 days agoWhy make it complicated?lemmy.mlimagemessage-square121linkfedilinkarrow-up1365arrow-down139file-text
arrow-up1326arrow-down1imageWhy make it complicated?lemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-23 days agomessage-square121linkfedilinkfile-text
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up1·3 days agoMaybe it’s a language without type interference? Either way, it sometimes makes sense in TypeScript to help the type system out a little bit. let array: string[] = []; In this situation, the type system can’t infer that the empty array should be a string array, because there are no items to go by.
Maybe it’s a language without type interference?
Either way, it sometimes makes sense in TypeScript to help the type system out a little bit.
let array: string[] = [];
In this situation, the type system can’t infer that the empty array should be a
string
array, because there are no items to go by.