372
submitted 1 year ago by mvmike@lemmy.ml to c/memes@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] sib@lemmy.world 12 points 1 year ago
[-] illectrility@lemmy.world 6 points 1 year ago* (last edited 1 year 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@lemmy.w.on-t.work 4 points 1 year ago
[-] GTG3000@programming.dev 1 points 1 year ago

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

Separate fields, bitches.

[-] PeWu@lemmy.ml 1 points 1 year ago

Love me some JS brother

[-] jannis@feddit.de 2 points 1 year ago

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

this post was submitted on 26 Jun 2023
372 points (100.0% liked)

Memes

45666 readers
486 users here now

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.

founded 5 years ago
MODERATORS