HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-21 day agoWhy make it complicated?lemmy.mlimagemessage-square97fedilinkarrow-up1315arrow-down128file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1287arrow-down1imageWhy make it complicated?lemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-21 day agomessage-square97fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up1·8 hours 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.