After that, we elaborated on the different types of functions, how they differ from each other, and discussed different case scenarios for when you might want to use each type of function. We talked about basic functions, anonymous functions, callback functions, and functions in objects, along with how to get your functions working together by returning and passing data to one another, returning both single and multiple values.
Before this chapter, we were accessing items directly when working with data. This chapter showed how to execute the same code over and over for each data item in the form of a loop. We learned about the for loop specifically and talked about performance considerations and why the loop is assembled in the way it is.
After loops, we got into conditionals in the form of if/else and switch statements. They appear similar on the surface, but we also talked about why they’re different and the scenarios where you may want to use one style over the other.