Functions and Closures
摘要
Functions and closures are both blocks of code that can be reused, but they have different strengths and weaknesses. Functions are named blocks of code that can be invoked from anywhere in your program. They help to encapsulate a piece of functionality and to make it reusable, for example, to define a function to calculate the factorial of a number or any other mathematical operation or to format a string.