Skip to content

Latest commit

 

History

History

the-if-function

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Create a function called _if which takes 3 arguments: a value bool and 2 functions (which do not take any parameters): func1 and func2

When bool is truthy, func1 should be called, otherwise call the func2.

Example:

Kata._if(true, () -> System.out.println("true"), () -> System.out.println("false"));
// prints "true" to the System out.