JavaScript Mixins

2021 VietMX 0

In JavaScript we can only inherit from a single object. There can be only one [[Prototype]] for an object. And a class may extend only one other […]

JavaScript Class basic syntax

2021 VietMX 0

In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions or methods). […]

JavaScript Native prototypes

2021 VietMX 0

The “prototype” property is widely used by the core of JavaScript itself. All built-in constructor functions use it. First we’ll see at the details, and then how […]

JavaScript F.prototype

2021 VietMX 1

1. Overview Remember, new objects can be created with a constructor function, like new F(). If F.prototype is an object, then the new operator uses it to set [[Prototype]] for the new […]

JavaScript Function binding

2021 VietMX 0

When passing object methods as callbacks, for instance to setTimeout, there’s a known problem: “losing this“. In this chapter we’ll see the ways to fix it. 1. […]

JavaScript Global object

2021 VietMX 0

1. Overview The global object provides variables and functions that are available anywhere. By default, those that are built into the language or the environment. […]