- cross-posted to:
- programminghumor@lemmy.world
- programmerhumor@lemmy.ml
- cross-posted to:
- programminghumor@lemmy.world
- programmerhumor@lemmy.ml
Made with KolourPaint and screenshots from Kate (with the GitHub theme).
Made with KolourPaint and screenshots from Kate (with the GitHub theme).
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
Ah, but this is JS, so there are three options! And they all function entirely differently. And your assumptions don’t apply, either. :D
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.