Blåhaj Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
mvmike@lemmy.ml to Memes@lemmy.ml · 2 years ago

We've all been there

lemmy.ml

message-square
18
link
fedilink
372

We've all been there

lemmy.ml

mvmike@lemmy.ml to Memes@lemmy.ml · 2 years ago
message-square
18
link
fedilink
  • sib@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    2 years ago

    LastName = Name[1]

    • illectrility@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      2 years ago

      The only right answer… But wouldn’t Name[1] be ‘e’ in this case? I would add a .split(' ') to avoid confusion.

      So the full answer would be Name.split(' ')[1]

      Why do I always over think stuff like this…

      Edit: they also shouldn’t capitalize variable names

      • ShittyKopper [they/them]@lemmy.w.on-t.work
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

        • GTG3000@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          There’s a reason I refuse to try parsing names as a string separated by spaces.

          Separate fields, bitches.

      • PeWu@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Love me some JS brother

    • Jannis@feddit.de
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Could be the middle name though, better use name[name.length-1]

Memes@lemmy.ml

memes@lemmy.ml

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: !memes@lemmy.ml

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.
Visibility: Public
globe

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

  • 841 users / day
  • 3.03K users / week
  • 7.99K users / month
  • 20.2K users / 6 months
  • 658 local subscribers
  • 50.3K subscribers
  • 12.8K Posts
  • 248K Comments
  • Modlog
  • mods:
  • ghost_laptop@lemmy.ml
  • sexy_peach@feddit.de
  • Cyclohexane@lemmy.ml
  • Arthur Besse@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org