mvmike@lemmy.ml to Memes@lemmy.ml · 2 years agoWe've all been therelemmy.mlimagemessage-square18fedilinkarrow-up1349arrow-down13
arrow-up1346arrow-down1imageWe've all been therelemmy.mlmvmike@lemmy.ml to Memes@lemmy.ml · 2 years agomessage-square18fedilink
minus-squareillectrility@lemmy.worldlinkfedilinkarrow-up6·edit-22 years agoThe 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
minus-squareShittyKopper [they/them]@lemmy.w.on-t.worklinkfedilinkarrow-up4·2 years agohttps://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
minus-squareGTG3000@programming.devlinkfedilinkarrow-up1·2 years agoThere’s a reason I refuse to try parsing names as a string separated by spaces. Separate fields, bitches.
minus-squareJannis@feddit.delinkfedilinkarrow-up2·2 years agoCould be the middle name though, better use name[name.length-1]
LastName = Name[1]
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
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
There’s a reason I refuse to try parsing names as a string separated by spaces.
Separate fields, bitches.
Love me some JS brother
Could be the middle name though, better use name[name.length-1]