@HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish • edit-215 hours agoWhy make it complicated?lemmy.mlimagemessage-square74fedilinkarrow-up1257arrow-down10file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1257arrow-down1imageWhy make it complicated?lemmy.ml@HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish • edit-215 hours agomessage-square74fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-square@masterspace@lemmy.calinkfedilinkEnglish29•14 hours agoYeah, 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-square@Hotzilla@sopuli.xyzlinkfedilink3•edit-28 hours 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.
Yeah, it’s explicitly distinct from
const a: String
which 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.