This is good start to understand function
https://funprogramming.org/31-Function-parameters-and-return-values.html