Gifted Minecraft
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 18 hours ago

The meaning of this

lemmy.world

message-square
10
fedilink
243

The meaning of this

lemmy.world

cm0002@lemmy.world to Programmer Humor@programming.dev · 18 hours ago
message-square
10
fedilink
alert-triangle
You must log in or register to comment.
  • Justas🇱🇹@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    12 minutes ago

    let self = this;

  • fnrir@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    1
    ·
    50 minutes ago

    Rust: do you mean Self or self?

  • sourhill@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    10
    ·
    6 hours ago
    const that = this;
    
  • Strawberry@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    5 hours ago

    I did not know that about event handlers, that is actually super convenient

  • TootSweet@lemmy.world
    link
    fedilink
    English
    arrow-up
    19
    ·
    12 hours ago

    Go:

    MCU universe Loki saying "I've never met this man in my life."

    • Kairos@lemmy.today
      link
      fedilink
      arrow-up
      1
      ·
      3 hours ago

      deleted by creator

  • mindbleach@sh.itjust.works
    link
    fedilink
    arrow-up
    18
    ·
    15 hours ago

    “We wanted it to work like Perl,” said someone who should have been killed on the spot.

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      7
      ·
      14 hours ago

      At the time JS was created, Perl didn’t have a this. A lot of the docs and books suggested using $self but a reference to the object would be passed as the first parameter to all class methods and you assign that to any name you wanted.

      It’s only very recently (as in the last year or so) with a new class system that Perl has hard-coded $self for that purpose.

      • mindbleach@sh.itjust.works
        link
        fedilink
        arrow-up
        4
        ·
        12 hours ago

        I mean $_.

        • palordrolap@fedia.io
          link
          fedilink
          arrow-up
          2
          ·
          11 hours ago

          Ah. The usually implicit topical “this” didn’t even occur to me because I thought, er, this, was about objects. $_ isn’t used for those in Perl.

          I suppose there might be some parallels with the implicit nature of $_ in non-OO contexts in Perl versus this in OO contexts in Javascript, but, at least to me, that feels pretty tenuous.

  • nnullzz@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    15 hours ago

    Yeah, this is that.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.49K users / day
  • 5.83K users / week
  • 9.89K users / month
  • 19K users / 6 months
  • 1 local subscriber
  • 24K subscribers
  • 1.4K Posts
  • 46.6K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org