Category: 6. Object Oriented JavaScript
-
Proxies
Proxy in JavaScript The JavaScript proxies are objects that allow you to wrap a particular object and customize the fundamental operations of the object, like getting and setting object properties. In short, using the proxy object, you can add custom behavior to the object. The proxies are used to implement features such as logging, caching, and securities.…
-
Global Object
Global Objects in JavaScript The JavaScript global object allows you to access the variables, functions, objects, etc., defined in the global scope and available everywhere in the code. In the browser, a global object is named as ‘window‘, and in Node.js, the global object is named ‘global‘. However, the global object could have different names in different…
-
Optional Chaining
The optional chaining in JavaScript allows you to access nested properties and methods of an object without checking if each property exists. This can help to make your code more concise and easier to read. The optional chaining operator (?.) is sued to achieve optional chaining in JavaScript. It is placed before the property or…
-
Nested Destructuring
Nested Destructuring The Nested Destructuring in JavaScript allows us to extract data from nested objects and arrays. An object (or array) can contain another object (or array) inside itself, known as a nested object (or array). Unpacking the nested objects or arrays is called nested destructuring. We can extract all or some data from the objects or arrays using…
-
Array Destructuring
Array Destructuring JavaScript Array destructuring allows us to unpack the values from array and assign them to the variables. After that, you can use the variables to access their value and use them in the code. We can perform the array structuring using the destructuring assignment. The destructuring assignment is a basically a JavaScript expression.…
-
Object Destructuring
Object Destructuring The object destructuring assignments are JavaScript expressions that allow you to unpack and assign object properties into individual variables. The name of the individual variables can be the same as the object properties or different. The object destructuring is a very useful feature when you have an object with a lot of properties…
-
Destructuring Assignment
Destructuring Assignment In JavaScript, the destructuring assignment is an expression that allows us to unpack the values from the arrays or objects and store them in individual variables. It is a technique to assign array values or object properties to the variables. The destructuring assignment syntax is introduced in ECMAScript 6 (ES6). Before ES6, developers were unpacking…
-
Destructuring
Destructuring is a simple term we can use to extract values from array and properties from object. It is a JavaScript expression that help to unpack values from array or similarly properties from object into different variables. Let’s say you have a box that contain multiple items. Now, imagine someone asks you to take out…
-
Polymorphism
Polymorphism in JavaScript The polymorphism in JavaScript allows you to define multiple methods with the same name and different functionalities. Polymorphism is achieved by using method overloading and overriding. JavaScript does not support method overloading natively. Method overriding allows a subclass or child class to redefine a method of superclass or parent class. In this chapter, we will implement the…
-
Abstraction
Abstraction in JavaScript The Abstraction in JavaScript can be achieved using the abstract class. In object-oriented programming, the abstraction concept allows you to hide the implementation details and expose features only to the users. For example, you can execute the Math object methods in JavaScript by accessing the method using its name but cant see…