In this chapter, you will learn how to write and use functions in ReScript, and discuss topics such as recursion, pipes, and polymorphism. We’ll also introduce functional programming concepts like purity and using functions as values.
Defining and Using Functions
ReScript’s function definition syntax is very similar to the syntax for anonymous functions in JavaScript. The body of a function is a single expression or block, and the result of evaluating the body is the value that is returned from the function.