Chapter 7: Functions
So far, throughout this book, we have learned about the basic programming features of V, including arrays, maps, conditionals, and iterative statements. It's time for us to learn about writing functions in V. Most programmers, when writing software applications, prefer to group a set of statements such as variable declarations and perform arithmetic or logical operations with them, or iterate over the elements of an array or map and then filter them according to their need. The art of wrapping or grouping a logically related set of statements, providing it with a name, and optionally providing input arguments and return types is often referred to as the process of writing a function.
Before we begin, here is a brief outline of the topics we will cover in this chapter:
- Introducing functions
- Understanding function types
- Understanding function features
By the end of this chapter, you will have a solid understanding of the various types...