HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-22 days agoWhy make it complicated?imagemessage-square106linkfedilinkarrow-up1342arrow-down133file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1309arrow-down1imageWhy make it complicated?HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-22 days agomessage-square106linkfedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up1·22 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.