1const p = {
2 "p1": "value1",
3 "p2": "value2",
4 "p3": "value3"
5};
6
7for (let [key, value] of Object.entries(p)) {
8 console.log(`${key}: ${value}`);
9}
10
1var p = {
2 0: "value1",
3 "b": "value2",
4 key: "value3"
5};
6
7for (var key of Object.keys(p)) {
8 console.log(key + " -> " + p[key])
9}