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;
  • @Tyfud
    link
    21 year ago

    Const keyword means constant, a value that won’t change after the application has been compiled; this allows for certain optimizations.

    Let keyword is a JavaScript variable that is safely scoped down to the method or function level.

    Var keyword is generally discouraged in JavaScript, because it’s a global declaration. The value of it could be available anywhere in the application, and the app might have collisions.

    So, the meme is, shifting from a constant, unchanging gender, to the middle where gender is defined and scoped to a local level, to the extreme, where gender is variable globally.

    • xigoi
      link
      fedilink
      11 year ago

      Const keyword means constant, a value that won’t change after the application has been compiled; this allows for certain optimizations.

      JavaScript does not have compile-time constants (it’s usually not compiled after all). The const keyword declares an immutable variable.

      Let keyword is a JavaScript variable that is safely scoped down to the method or function level.

      Variables declared with let are scoped to the block, not to the function.

      Var keyword is generally discouraged in JavaScript, because it’s a global declaration. The value of it could be available anywhere in the application, and the app might have collisions.

      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”).