225
Gender.js (lemmy.world)

cross-posted from: https://lemmy.world/post/10094818

spoilerGender 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;

you are viewing a single comment's thread
view the rest of the comments
[-] andrew@lemmy.stuart.fun 2 points 8 months ago* (last edited 8 months ago)
var a;
(function() {
  a='hoisted';
  console.log(a);
  var a;
})()
console.log(a);

Should log hoisted and then undefined, showing that you've assigned to the later-declared var a which was hoisted vs the external global a.

this post was submitted on 29 Dec 2023
225 points (79.8% liked)

Programmer Humor

32070 readers
459 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS