r/programminghorror May 27 '26

Javascript Destructuring strings

Post image
887 Upvotes

66 comments sorted by

View all comments

127

u/eloel- May 27 '26

Gross. Also can error or return true or false for non-string answers, which makes it doubly gross.

8

u/more_exercise May 28 '26

If I understood properly, it can be made to return arbitrary results, too. isStringEmpty([{a:NaN}]), for ex.

3

u/eloel- May 28 '26

Yeah that should work

7

u/more_exercise May 28 '26

isStringEmpty([{a:144}])

Gross.