Our program's control flow is what keeps it running. Although variables and constants hold all of the interesting data, control flow statements allow us to use the data to make useful decisions.
Flowcharts are a fantastic way to visualize control flow, and explaining a problem with a high-level flowchart before digging into the code is often simpler. Code is a more efficient and (with practice) natural way of communicating control flow than flowcharts (many attempts have been made to construct programming languages that were visual only, yet text-based languages have never been threatened by this usurper).
Like most modern languages, JavaScript has a large and useful collection of operators that can be used to manipulate data. Some, like the bitwise operators, are only likely to be used once in a while.
Others, such as member access managers, aren't always considered operators (though they can be useful when trying to solve a difficult operator precedence problem). Assignment, arithmetic, comparison, and Boolean are the most common operators, and you'll be using them often, so make sure you understand them before going on.
JavaScript relies heavily on functions. They are capable of constructing extremely efficient algorithmic units in addition to simply modularizing code. The mechanics of functions have been the focus of this chapter, which is a dry but necessary introduction.
We'll see the power of functions unleashed in the following chapters once we've established this base. Since the value is copied as primitives are passed around in JavaScript, they are referred to as value forms in computer science.
Objects are referred to as reference types since all variables refer to the same object as they are passed around (that is, they both hold a reference to the same object). Similar features can be done in ES5 using arguments, a special variable that only exists within function bodies. This variable was not an array, but rather a "array-like" object that needed special handling or conversion to a true array.
Buy it Now and let your customers get addicted to this amazing book !!!We publiceren alleen reviews die voldoen aan de voorwaarden voor reviews. Bekijk onze voorwaarden voor reviews.