Skip to content

Instantly share code, notes, and snippets.

@vielhuber
Created October 8, 2023 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vielhuber/61bc88530bba1f0b8df1556eb01c58a0 to your computer and use it in GitHub Desktop.
Save vielhuber/61bc88530bba1f0b8df1556eb01c58a0 to your computer and use it in GitHub Desktop.
destructuring spread arrays/objects in for loop #js
let arr = [['foo','bar'],['bar','baz']];
for(let [arr__value_1,arr__value_2] of arr) { console.log([val_a,val_b]); }
// ['foo','bar'], ['bar','baz']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment