var count=0;
let myArray = '{"1":"a","2":"b","3":"c","4":"d"}'
var data = JSON.parse(myArray);
for (let key in data) {
let value = data[key]; // get the value by key
console.log("key: , value:", key, value);
count = count + 1;
}
console.log("size:",count);