HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-26 mesi faWhy make it complicated?lemmy.mlimagemessage-square124fedilinkarrow-up1371arrow-down138file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1333arrow-down1imageWhy make it complicated?lemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-26 mesi famessage-square124fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squaremasterspace@lemmy.calinkfedilinkEnglisharrow-up35arrow-down1·6 mesi faYeah, it’s explicitly distinct from const a: String which says it won’t change, and var a: String, which means this is legacy code that needs fixing.
minus-squarePsaldorn@lemmy.worldlinkfedilinkarrow-up10·6 mesi faIf there’s only two options you only need one keyword
minus-squareHotzilla@sopuli.xyzlinkfedilinkarrow-up5·edit-26 mesi faTrue, but var and let are not same in js, so there is three. if(true) { var a = "dumdum" } console.log(a) Is valid and functioning javascript. With let it is not.
minus-squareLemminary@lemmy.worldlinkfedilinkarrow-up1·6 mesi faAh, but this is JS, so there are three options! And they all function entirely differently. And your assumptions don’t apply, either. :D
Yeah, it’s explicitly distinct from
const a: Stringwhich says it won’t change, andvar a: String, which means this is legacy code that needs fixing.If there’s only two options you only need one keyword
True, but var and let are not same in js, so there is three.
if(true) {var a = "dumdum"}console.log(a)Is valid and functioning javascript. With let it is not.
Ah, but this is JS, so there are three options! And they all function entirely differently. And your assumptions don’t apply, either. :D