Today I will be showing you all how functions are defined and executed in the Hack programming languages. I will be using a recursive function in this example. More specifically this example will a given number to its equivalent to the Fibonacci sequence.
Functions in are defined using the function keyword followed by parameters (in parentheses )and then colon the type of data to return.
Fibonacci numbers are commonly associated with recursion. The fibonacci sequcence consists of summing the previous numbers of the current number.
Below is the Hack code for fibonacci notice I take an integer parameter and return one.

As you can see it is recursion by calling itself to come to an eventual answer. I say eventual answer because this is not the most efficient way to solve this problem.
Below is the output to the recursive program I have constructed.

There it is the program computed the Fibonacci of 15 as 610. Tune in next week for more excitement on the Hack language