If you're using this exact structure, you can do something like this. Where inputData is the first JSON structure, and outputData will be the data outputted.
var outputData = [];
for(var i = 0; i < inputData.length; i++) {
var input = inputData[i];
outputData.push([input.Earning, input.Number]);
}