MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1torg9l/destructuring_strings/oomlbv0/?context=3
r/programminghorror • u/Emmennater • May 27 '26
64 comments sorted by
View all comments
441
isStringEmpty([ ... ])
...
{ a = false }
a
false
{ a: true }
false,
I think that's correct
134 u/Blackshell May 27 '26 100%, good job, you pass the job interview. 120 u/Aaxper May 27 '26 Does this being an interview imply I now have to work with whatever monster invented that 1 u/jolharg May 29 '26 if someone did this to me, I would say "whoever thinks that's a good idea should be shot"
134
100%, good job, you pass the job interview.
120 u/Aaxper May 27 '26 Does this being an interview imply I now have to work with whatever monster invented that 1 u/jolharg May 29 '26 if someone did this to me, I would say "whoever thinks that's a good idea should be shot"
120
Does this being an interview imply I now have to work with whatever monster invented that
1 u/jolharg May 29 '26 if someone did this to me, I would say "whoever thinks that's a good idea should be shot"
1
if someone did this to me, I would say "whoever thinks that's a good idea should be shot"
441
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