Skip to content

Instantly share code, notes, and snippets.

@shaosh
Last active March 17, 2016 23:31
Show Gist options
  • Save shaosh/dbf3cecebe546dc8acd0 to your computer and use it in GitHub Desktop.
Save shaosh/dbf3cecebe546dc8acd0 to your computer and use it in GitHub Desktop.
Extract int keys and output in one line with comma
var c = [{'32059': 'true'}, {'32074': 'true'}, {'32062': 'true'}, {'32065': 'true'}, {'32068': 'true'}, {'32071': 'true'}];
var keys = [];
for(var k in c){
var a = c[k];
keys.push(parseInt((Object.keys(a))[0]));
}
keys.join(", ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment