Question: "Modify the car-painting example so that the car is painted with your favorite color if you have one; otherwise it is painted w/ the color of your garage (if the color is known); otherwise it is painted red."
Car-painting example: 
car.color = favoriteColor || "black";

**How or what do I need to do to make my script work?**

```
car.color = favoriteColor || "red";
if (car.color = favoriteColor ){ 
    alert("your car is " + favoriteColor);

} else if (car.color = garageColor){
    alert("your car is " + garageColor);

} else {
    car.color = "red";
}

```

Answer: 
**This is the correct answer to your question:**

See my comments to get a better understanding of how this works.

```
if (favoriteColor) {
  car.color = favoriteColor; // If you have a favorite color, choose the favorite color.
} else if (garageColor) {
  car.color = garageColor;   // If the garage color is known, choose the garage color.
} else {
  car.color = 'red';         // Otherwise, choose the color 'red'.
}

alert('Your car is: ' + car.color);

```

**[Try it Online!](https://jsfiddle.net/jem6wp11/9/)**

**Related Question (for further insight):**

<https://softwareengineering.stackexchange.com/q/289475>

**Alternative Method:**

As another possibility, you can write a [conditional (ternary) operation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) to compact all of the logic into a single statement.

```
alert('Your car is: ' + (car.color = favoriteColor ? favoriteColor : garageColor ? garageColor : 'red'));

```
It just looks like you need to use double equals signs in your if statement. Use == when checking for equality. Try this:

```
car.color = favoriteColor || "red";
if (car.color == favoriteColor ){ 
    alert("your car is " + favoriteColor);

} else if (car.color == garageColor){
    alert("your car is " + garageColor);

} else {
    car.color = "red";
}

```