Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Use `for in` to Loop Through an Object's Properties 4:31
- Loop Through an Object's Properties 2 objectives
- Useful JavaScript Object Methods
- Store Objects in Arrays 3:45
- Create an Array of Objects 2 objectives
- Build an Object Challenge 1:17
- Build an Object Challenge – One Solution 3:09
- Display an Array of Objects on the Page – One Solution 7:14
- Review `for in` and Arrays of Objects 6 questions
Instruction
Useful JavaScript Object Methods
You've learned that with for...in
, you're able to loop (or iterate) over the properties of an object literal and access each property's value. For example:
const person = {
name: 'Reggie',
role: 'Software developer',
skills: ['JavaScript', 'HTML', 'CSS'],
isTeacher: true
};
for ( let prop in person ) {
console.log(prop);
}
The for...in
loop above calls th...