Question: How can I use OR in a ternary operator? Here's what I'm trying to do:

`let surname = name == "John" || "Jack" ? "Johnson" : "Smith"`

Answer: 
Use brackets:

```
let surname = (name == "John" || name == "Jack") ? "Johnson" : "Smith"

```

These brackets are necessary because you want to evaluate first if `name` is either *John* or *Jack* before "passing" that result to the ternary operator.

Additionally, like in a all C-like languages, you have to mention `name` twice, unlike the example code in your question, in order to compare it with "John" and "Jack".

If you want to avoid naming *name* twice, you can write instead:

```
let surname = ["John", "Jack"].contains(name) ? "Johnson" : "Smith"

```

The latter makes use of the `contains()` function of arrays.
Please be aware of **Operator precedence**

You should use brackets to form valid condition.

```
let surname = (name == "John" ||  name ==  "Jack") ? "Johnson" : "Smith"

```