Skip to content

Instantly share code, notes, and snippets.

@ashnur

ashnur/q.js Secret

Last active April 13, 2016 07:21
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 ashnur/34e241049825d1e66ce5519c20c52689 to your computer and use it in GitHub Desktop.
Save ashnur/34e241049825d1e66ce5519c20c52689 to your computer and use it in GitHub Desktop.
// from this:
{xs:[{ key: "x", values: [ {order: 1, rec: {x:1, y:2, z:3}}
, {order: 2, rec: {x:5, y:7, z:9}}]}
,{ key: "z", values: [ {order: 1, rec: {x:"a", y:"b", z:"c"}}
, {order: 2, rec: {x:"h", y:"i", z:"j"}}]}
]}
// this(order of elements is by the order attr):
[{1:"c"}, {5: "j"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment