- cross-posted to:
- programmerhumor@lemmy.world
- cross-posted to:
- programmerhumor@lemmy.world
cross-posted from: https://lemmy.world/post/10094818
spoiler
Gender variability as declarations in JavaScript: const / let / var
Meme is based on Jordan Peterson “approival / disapproval” format, him being a conservative who disapproves of gender fluidity.
Transcript:
- Jordan Peterson approval image: const gender;
- Jordan Peterson angry image: let gender;
- Jordan Peterson crying image: var gender;
JavaScript does not have compile-time constants (it’s usually not compiled after all). The
const
keyword declares an immutable variable.Variables declared with
let
are scoped to the block, not to the function.var
is scoped to the function, not globally (unless it’s at the global level). It is discouraged because of its confusing semantics (“variable hoisting”).