I have a big Array with 100.000 objects in JSON in it. Since I need to have certain key/values of those objects grouped together in different arrays I created new arrays with just a couple of key/values from the original array.
Just an example array:
var data = [
{
"ID": 1,
"Completed": "yes",
"Prio": 3,
"Importance": 2
},
{
"ID": 2,
"Completed": "yes",
"Prio": 4,
"Importance": 4
}
]
Creating one new Array:
var newArray = [];
for (var i = 0; i < data.length; i++) {
newArray[i] = {"ID": data[i].ID, "Prio": data[i].Prio};
}
Now it would be nice if I could have separate files, each with an array containing different key/values pairs from the original one (the "data" array).
How can I get those new arrays to in new files? Or how can I at least let me output all objects with each element in them to copy and past that in a new file?
Could JSON help me there?