When I do JArray.toSource(), I get this:-
[{selectionID:"1", cnt:"5"}, {selectionID:"2", cnt:"2"}, {selectionID:"3", cnt:"1"}]
How can I convert JArray to format like this:-
[[1,5],[2,2],[3,1]]
in JavaScript.
Eventually I want newJArray.toSource() become [[1,5],[2,2],[3,1]]
pimvdb’s solution is very nice. My comment is that in this particular case this is enough:
It is uglier (more specific), but my gut feeling is that it’s much more efficient (and sometimes that matters).