Switch

Introduction

Switch clauses are made of a tuples of function predicates and functions.

To use them add an indentation level and the function predicate wrapped with the keyword : and followed by the function.

If you want to define a default case, you can use the keyword default or none as the function predicate.

Example

{ type: 'DOG', tail: true }

Example with default case

{ type: 'BEAR', eyes: true }