Skip to content

Instantly share code, notes, and snippets.

@sw360cab
Created August 24, 2020 17:48
Show Gist options
  • Save sw360cab/1bb5ee8100ec97ac325e633584b371a7 to your computer and use it in GitHub Desktop.
Save sw360cab/1bb5ee8100ec97ac325e633584b371a7 to your computer and use it in GitHub Desktop.
> obj = { rows : [{count: 10}, {count:20}] }
{ rows: [ { count: 10 }, { count: 20 } ] }
> {rows: [{count: val}]} = obj
{ rows: [ { count: 10 }, { count: 20 } ] }
> val
10
> {rows: [{count}]} = obj
{ rows: [ { count: 10 }, { count: 20 } ] }
> count
10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment