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)

DOM Events and Event Objects


DOM events are the backbone of functional and responsive web applications. Events are used in any website that has any form of user interaction. Websites such as Facebook, Google, and Skype all heavily make use of events. An event is a signal that tells the programmer that something has happened to a DOM node. An event can be fired for nearly any reason. We can use JavaScript to listen for events and run functions when an event occurs.

DOM Event

A DOM event is a notification sent by a DOM node to let the programmer know that something has happened to the DOM node. This can be anything from a user clicking on an element or pressing a key on the keyboard to video playback ending. There are a lot of events that can be fired. Every event that can be fired can have an event listener attached to it. An event listener is an interface that waits for an event to fire and then calls an event handler. An event handler is code that is run in response to an event. Event handlers...