how to have a for statement in an object javascript code example
Example 1: js for in object
var obj = { foo: 'bar', baz: 42 };
console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ]
for(const [i, val] of Object.entries(obj))
new_obj[i] = val;
Example 2: loop in object javascript
var person = {"name":"Rasel", age:26};
for (var property in person) {
console.log(person[property]);
}