for items in object js code example
Example: for in object javascript
var obj = { foo: 'bar', baz: 42 };
Object.keys(obj).forEach((key) => {
const el = obj[key];
console.log(
{
key: key,
value: el
}
);
});
var obj = { foo: 'bar', baz: 42 };
Object.keys(obj).forEach((key) => {
const el = obj[key];
console.log(
{
key: key,
value: el
}
);
});