Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
Well done!
You have completed JavaScript Objects!
You have completed JavaScript Objects!
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...