Beginning AngularJS

(WallPaper) #1
ChApter 1 ■ JAvASCrIpt You Need to KNow




It’s well worth exploring these built-in functions and others like them. JavaScript’s dynamic type system is often
a good thing, but it does mean that any serious JavaScript programmer has to become accustomed to how types are
being managed behind the scenes.


Pre- vs. Post-Increment

I will finish this section by looking at the last of the special cases: the pre- and post-increment operators (++) and their
decrement (--) counterparts.
These operators are relatively easy to understand on the surface. Essentially, they are a more compact way of
performing operations, such as the following:


myNumber = myNumber + 1;
myNumber += myNumber;


Another way that you can achieve the same result as the preceding two techniques is as follows:

myNumber = ++myNumber;

Free download pdf