Question: JAVASCRIPT I need to display each property from this object in the console using the FOR LOOP (the for loop not the FOR IN) that
JAVASCRIPT
I need to display each property from this object in the console using the FOR LOOP (the for loop not the FOR IN) that will be inside a display function
I have this but it doesn't work.
var person = {
id = 1234,
name = "Steph",
lastName = "Lee",
salary = 1000,
city = "dallas"
};
function (){
for (var i = 0; i < person.length; i++) {
document.write(`Property: ${person[i]}`);
}
}
console.log(display());
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
