Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

JavaScript bind() Method

JavaScript bind() Method Summary: in this tutorial, you will learn about the JavaScript bind() method and know how to use it effectively. Introduction to JavaScript bind() method The bind() method returns a new function, when invoked, has its this sets to a specific value. The following illustrates the syntax of the bind() method: fn.bind(thisArg[, arg1[,…
Read more

JavaScript apply() method

JavaScript apply() method Summary: in this tutorial, you’ll learn about the JavaScript apply() method of the Function type and how to use it effectively. Introduction to the JavaScript apply() method The Function.prototype.apply() method allows you to call a function with a given this value and arguments provided as an array. Here is the syntax of…
Read more

JavaScript call() Method

JavaScript call() Method Summary: in this tutorial, you will learn about the JavaScript call() method and how to use it more effectively. Introduction to the JavaScript call() method In JavaScript, a function is an instance of the Function type. For example: function add(x, y) { return x + y; }console.log(add instanceof Function); // true Code…
Read more

JavaScript Function Type

JavaScript Function Type Summary: in this tutorial, you’ll learn about the JavaScript Function type, which is the type of all functions in JavaScript. Introduction to the JavaScript Function type In JavaScript, all functions are objects. They are the instances of the Function type. Because functions are objects, they have properties and methods like other objects.…
Read more

JavaScript Private Methods

JavaScript Private Methods Summary: in this tutorial, you’ll learn about JavaScript private methods including private instance methods, private static methods, and private getter/setter. Introduction to JavaScript private methods By default, members of a class are public. ES2020 introduced the private members that include private fields and methods. To make a public method private, you prefix…
Read more

JavaScript Private Fields

JavaScript Private Fields Summary: in this tutorial, you’ll learn about JavaScript private fields and how to use them effectively. Introduction to the JavaScript private fields ES2022 allows you to define private fields for a class. To define a private field, you prefix the field name with the # sign. For example, the following defines the…
Read more

JavaScript Static Properties

JavaScript Static Properties Summary: in this tutorial, you’ll learn about the JavaScript static properties of a class and how to access the static properties in a static method, class constructor, and other instance methods. Introduction to the JavaScript static properties Like a static method, a static property is shared by all instances of a class.…
Read more

JavaScript Static Methods

JavaScript Static Methods Summary: in this tutorial, you’ll learn about the JavaScript static methods and how to use them effectively. Introduction to the JavaScript static methods By definition, static methods are bound to a class, not the instances of that class. Therefore, static methods are useful for defining helper or utility methods. To define a…
Read more

Introduction to JavaScript new.target Metaproperty

Introduction to JavaScript new.target Metaproperty Summary: in this tutorial, you learn about the JavaScript new.target metaproperty that detects whether a function or constructor was called using the new operator. Introduction to JavaScript new.target ES6 provides a metaproperty named new.target that allows you to detect whether a function or constructor was called using the new operator. The new.target consists…
Read more

JavaScript Inheritance Using extends & super

JavaScript Inheritance Using extends & super Summary: in this tutorial, you will learn how to implement JavaScript inheritance by using extends and super in ES6. Implementing JavaScript inheritance using extends and super Prior to ES6, implementing a proper inheritance required multiple steps. One of the most commonly used strategies is prototypal inheritance. The following illustrates…
Read more