Prototype of compressing JSON into js-array