...

/

Solution Review: Pedestrian Movement

Solution Review: Pedestrian Movement

This lesson explains the solution for the pedestrian movement exercise.

We'll cover the following...

Solution

Press + to interact
let car = Some("Moving");
let pedestrian = (car) => {
switch(car) {
/* Handling all the values of car */
| None => "Cross"
| Some("Moving") => "Wait"
| _ => "Check"
};
};
Js.log(pedestrian(car));

Explanation

In the ...