I have the following object I created from a json file using jquery $.get. console.log(array);
[Object, Object, Object, Object, Object, Object, Object, Object]
0
:
Object
country
:
"Cameroon"
employ_count
:
50
__proto__
:
Object
1
:
bject
7
:
Object
length:8
__proto__
:
Array[0]
I am trying to convert each object to an array of this type ['Cameroon', 58], ['Germany', 58]....
I tried using jquery $.makeArray
var array = $.makeArray(emObj);
but this still returns an object.
[{"country":"Cameroon", "employ_count":50}, {"country":"Germany", "employ_count":58}]?) That console logged version is a bit hard to read."countries": [ { "country": "Cameroon", "employ_count": 50 } , ...] }