score:1

Accepted answer

Transform your object to an array. First, get the keys and second, combine them with the value to an array. If it is still not in order, you can sort the array.

var data = Object.keys(data2).map(function (key) { return [key, data2[key]]; });

Demo:

var data2 = {'A': 2, 'B': 3, 'C': 4, 'D': 5};

var data = Object.keys(data2).map(function (key) { return [key, data2[key]]; });

console.log(data);