Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rewrite the is_sbp function to return TRUE and FALSE
- var is_sbp = colour => (colour === "sky_blue_pink") ? TRUE : FALSE;
- // Store the responses to the colour test as a PAIR
- var colourResponses = PAIR(pigs.fly)(elephants.jump);
- // Now we can decide what action to take based on the colour
- colourResponses(is_sbp("sky_blue_pink")); // -> pigs.fly
- colourResponses(is_sbp("cherry_green")); // -> elephants.jump
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement