let paragraph = document.createElement('p');
document.body.appendChild(paragraph)
const fruit = {
type: 'Apple',
properties: {
color: 'Green',
price: {
bulk: '$3/kg',
smallQty: '$4/kg'
}
}
};
let text = ''
for (let key in fruit) {
text += fruit[key]
};
paragraph.innerHTML = text;
When viewing this in the browser, I am seeing Green[object Object]. Thank you.
///////////////