Json Object
su = "{"2018-05-15":4,"2018-05-18":7,"2018-05-12":25,"2018-04-16":26,"2018-05-13":15,"2018-05-02":42,"2018-04-22":11,"2018-05-06":20,"2018-04-29":20,"2018-05-17":2,"2018-04-14":14,"2018-04-12":43,"2018-04-25":67,"2018-05-14":9,"2018-06-03":3,"2018-05-23":7,"2018-05-24":3,"2018-05-11":55,"2018-05-10":31,"2018-04-26":24,"2018-05-31":23,"2018-05-21":5,"2018-05-22":8,"2018-05-09":43,"2018-04-30":27,"2018-06-02":5,"2018-06-01":5,"2018-06-04":16,"2018-04-28":7,"2018-04-15":6,"2018-06-05":3,"2018-04-19":27,"2018-06-08":4,"2018-06-06":2,"2018-04-20":15,"2018-05-30":6,"2018-05-07":57,"2018-04-13":35,"2018-04-17":37,"2018-05-28":9,"2018-05-01":23,"2018-04-24":35,"2018-05-26":6,"2018-05-16":3,"2018-04-21":16,"2018-06-07":1,"2018-05-25":1,"2018-05-03":44,"2018-05-08":43,"2018-04-23":30,"2018-05-04":35,"2018-05-19":6,"2018-05-05":7,"2018-04-18":26,"2018-04-27":22}"
How to I iterate through JSON object to get key value
Trying this below code. Giving unexpected output
Object.keys(su).forEach(function(key) {
console.log('Key : ' + key + ', Value : ' + su[key])
})
Output
Key : 0, Value : {
Key : 1, Value : "
Key : 2, Value : 2
Key : 3, Value : 0
.
.
.
.
Expected Output be like
Key : 2018-05-15, Value : 4
Key : 2018-05-18, Value : 7
Key : 2018-05-12, Value : 25
.
.
.
Can anybody find what mistake I am doing.