Outline

Here's one possible solution to the exercise:

// 1. !dog.name
const dog = {
  breed: 'Labradoodle'
}
console.log(!dog.name);

// 2. What is the value of name?
let name = !!dog.name;
console.log(name);
name = !dog.name
console.log(name);

// 3. Provide a value for the ifStatement variable using the not operator and the name attribute so that you enter the if statement.
const ifStatement = !dog.name;
if (ifStatement) {
  dog.name = 'Max';
}
console.log(dog);

Fork this StackBlitz project to see the answer key from this video.

 

I finished! On to the next chapter