MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1torg9l/destructuring_strings/oo4vsic/?context=3
r/programminghorror • u/Emmennater • May 27 '26
64 comments sorted by
View all comments
Show parent comment
12
to be able to do something like this:
const doSomething = () => { return [result, message]; } const [ doSomethingResult, doSomethingMessage ] = doSomething();
instead of
const doSomething = () => { return [result, message]; } const resultAndMessage = doSomething(); const doSomethingResult = resultAndMessage.result; const doSomethingMessage = resultAndMessage.message;
View all comments
Show parent comment
12
u/Lumethys May 27 '26
to be able to do something like this:
instead of