Book Image

Advanced JavaScript

By : Zachary Shute
Book Image

Advanced JavaScript

By: Zachary Shute

Overview of this book

If you are looking for a programming language to develop flexible and efficient applications, JavaScript is an obvious choice. Advanced JavaScript is a hands-on guide that takes you through JavaScript and its many features, one step at a time. You'll begin by learning how to use the new JavaScript syntax in ES6, and then work through the many other features that modern JavaScript has to offer. As you progress through the chapters, you’ll use asynchronous programming with callbacks and promises, handle browser events, and perform Document Object Model (DOM) manipulation. You'll also explore various methods of testing JavaScript projects. In the concluding chapters, you'll discover functional programming and learn to use it to build your apps. With this book as your guide, you'll also be able to develop APIs using Node.js and Express, create front-ends using React/Redux, and build mobile apps using React/Expo. By the end of Advanced JavaScript, you will have explored the features and benefits of JavaScript to build small applications.
Table of Contents (9 chapters)

Immutability


Immutability is a very simple concept but very important to Functional Programming. The textbook definition of immutability is simply "something that is not changeable." In programming, we use the word to mean objects and variables whose state cannot be changed after they have been created.

In software development, values can be passed into functions by reference. When a variable is passed by reference, it means that a reference to the memory location (a pointer) is passed instead of the serialized value of the object contained at that location in memory. Since all of the pointers for a variable passed by reference point to the same block of memory, any update to the value of the variable passed by reference will be seen by any pointer pointing to that block of memory. Any variable passed by reference instead of by value can be considered a shared state, since it can be modified by multiple separate scopes. It is important to write functions that prevent the mutation of data...