Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started