HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-23 个月前Why make it complicated?lemmy.mlimagemessage-square123fedilinkarrow-up1371arrow-down138file-textcross-posted to: [email protected]
arrow-up1333arrow-down1imageWhy make it complicated?lemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-23 个月前message-square123fedilinkfile-textcross-posted to: [email protected]
minus-squarePsaldorn@lemmy.worldlinkfedilinkarrow-up10·3 个月前If there’s only two options you only need one keyword
minus-squareHotzilla@sopuli.xyzlinkfedilinkarrow-up5·edit-23 个月前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.
minus-squareLemminary@lemmy.worldlinkfedilinkarrow-up1·3 个月前Ah, 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