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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!