Course lesson

Create an ifElse Operator to Fork on a Condition

So far, we've used filter to prevent values when a condition is met. Sometimes you want two different behaviors based on a condition which is where you would naturally reach for an if and an else. Let's take a look at what an ifElse operator would look like...

Duration
3 min
Access
Pro
Transcript
Available

So far, we've used filter to prevent values when a condition is met. Sometimes you want two different behaviors based on a condition which is where you would naturally reach for an if and an else. Let's take a look at what an ifElse operator would look like in the context of our live search box.