Object.values = function(obj){ return Object.keys(obj).map(function(key){ return obj[key] }) } var a = {2: "test", 3: "test2"}; console.log(Object.keys(a)); console.log(Object.values(a)); Run code snippet