Functions
Declare a function
Arrow functions (lambda)
Like JavaScript or C#, but our functions have no "this", so arrow function is a short way to create a function.
Summary:
func keyword helps you declare a function in top-level of code.
Arrow function creates a function as an expression.
Closures & bindings
We have an example, a counting program:
The count variable is binded in two functions, increase() and decrease(). When we call one of them, the value of count will be modified.
Last updated