Functions are pieces of code that can be executed by other functions of your program.
Your program always starts with the main function.
main
See also asynchronous functions.
Methods are exactly the same as function, but they act on an object instance.