Book Image

Object-Oriented JavaScript - Third Edition

By : Ved Antani, Stoyan STEFANOV
5 (1)
Book Image

Object-Oriented JavaScript - Third Edition

5 (1)
By: Ved Antani, Stoyan STEFANOV

Overview of this book

JavaScript is an object-oriented programming language that is used for website development. Web pages developed today currently follow a paradigm that has three clearly distinguishable parts: content (HTML), presentation (CSS), and behavior (JavaScript). JavaScript is one important pillar in this paradigm, and is responsible for the running of the web pages. This book will take your JavaScript skills to a new level of sophistication and get you prepared for your journey through professional web development. Updated for ES6, this book covers everything you will need to unleash the power of object-oriented programming in JavaScript while building professional web applications. The book begins with the basics of object-oriented programming in JavaScript and then gradually progresses to cover functions, objects, and prototypes, and how these concepts can be used to make your programs cleaner, more maintainable, faster, and compatible with other programs/libraries. By the end of the book, you will have learned how to incorporate object-oriented programming in your web development workflow to build professional JavaScript applications.
Table of Contents (25 chapters)
Object-Oriented JavaScript - Third Edition
About the Authors
About the Reviewer
Customer Feedback
Built-in Functions
Regular Expressions

Reactive programming

Reactive programming is getting a lot of focus lately. This idea is relatively new and, like many new ideas, has lots of confusing, and sometimes contradictory information floating around. We discussed asynchronous programming earlier in this book. JavaScript takes asynchronous programming to new heights by providing first class language constructs that support it.

Reactive programming is essentially programming with asynchronous event streams. An event stream is a sequence of events happening over time. Consider the following diagram:

In the preceding diagram, time passes from left to right and different events occur over time. As the event happens over time, we can add an event listener to this whole sequence. Whenever an event happens, we can react to it by doing something.

Another type of sequence in JavaScript is an array. For example, consider the following lines of code:

    var arr = [1,1,13,'Rx',0,0]; 
    >>> [1, 1, 13...