Advertisement
Guest User

Untitled

a guest
Apr 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // Rewrite the is_sbp function to return TRUE and FALSE
  2. var is_sbp = colour => (colour === "sky_blue_pink") ? TRUE : FALSE;
  3.  
  4. // Store the responses to the colour test as a PAIR
  5. var colourResponses = PAIR(pigs.fly)(elephants.jump);
  6.  
  7. // Now we can decide what action to take based on the colour
  8. colourResponses(is_sbp("sky_blue_pink")); // -> pigs.fly
  9. colourResponses(is_sbp("cherry_green")); // -> elephants.jump
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement