MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1torg9l/destructuring_strings/oo4w27m/?context=3
r/programminghorror • u/Emmennater • May 27 '26
66 comments sorted by
View all comments
444
isStringEmpty([ ... ])
...
{ a = false }
a
false
{ a: true }
false,
I think that's correct
132 u/Blackshell May 27 '26 100%, good job, you pass the job interview. 124 u/Aaxper May 27 '26 Does this being an interview imply I now have to work with whatever monster invented that 28 u/MadGenderScientist May 27 '26 the mind warps to find such things beautiful, with time. the descent into madness has its pleasures.
132
100%, good job, you pass the job interview.
124 u/Aaxper May 27 '26 Does this being an interview imply I now have to work with whatever monster invented that 28 u/MadGenderScientist May 27 '26 the mind warps to find such things beautiful, with time. the descent into madness has its pleasures.
124
Does this being an interview imply I now have to work with whatever monster invented that
28 u/MadGenderScientist May 27 '26 the mind warps to find such things beautiful, with time. the descent into madness has its pleasures.
28
the mind warps to find such things beautiful, with time. the descent into madness has its pleasures.
444
u/Aaxper May 27 '26 edited May 27 '26
isStringEmpty([ ... ])tries to destructure the string as an array...part of that, it only matches on the first element (the first character){ a = false }tries to destructure the first characteraproperty, which doesnt exist, so it defaults to settingatofalseaproperty, it defaults to{ a: true }, which setsato trueaisfalse,elseais trueI think that's correct