HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-27 days agoWhy make it complicated?lemmy.mlimagemessage-square120fedilinkarrow-up1369arrow-down139file-textcross-posted to: [email protected]
arrow-up1330arrow-down1imageWhy make it complicated?lemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-27 days agomessage-square120fedilinkfile-textcross-posted to: [email protected]
minus-squarePsaldorn@lemmy.worldlinkfedilinkarrow-up10·7 days agoIf there’s only two options you only need one keyword
minus-squareHotzilla@sopuli.xyzlinkfedilinkarrow-up5·edit-26 days agoTrue, 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·5 days agoAh, but this is JS, so there are three options! And they all function entirely differently. And your assumptions don’t apply, either. :D
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