Found 6685 Articles for Javascript

Explain Popup Message using Event?

Rushi Javiya
Updated on 29-Dec-2022 15:14:48

685 Views

We can show the popup message to the app users using the popup box. We will learn about the different types of JavaScript popup boxes in this tutorial. There are three different types of popup boxes available in JavaScript below. Alert box Confirm box Prompt box We will learn about all popup boxes one by one below. Alert Box We can show the alert box using the window.alert() method. It simply shows the message in the popup box. We can use the alert box when we need to give some message to the users. For example, when the ... Read More

Explain Passport in Node.js?

Rushi Javiya
Updated on 29-Dec-2022 15:11:01

2K+ Views

The Passport is a node package, or library which we can install in any nodeJs project. The Passport provides the functionality for authentication in the app. Also, it provides different encryption strategies to encrypt user information, such as a password. For example, what if Facebook or Google employees could see the password of their users? It is against user privacy. So, in such cases, we can use the Passport, which encrypts the password and stores it in the database. We should know the decryption algorithm and secret key to decrypt the password. Also, the Passport allows us to establish the ... Read More

Explain page redirection in ES6?

Rushi Javiya
Updated on 29-Dec-2022 15:02:25

160 Views

This tutorial will cover page redirection, introduced in the ES6 version of JavaScript. Page redirection is a way to send web page visitors to another URL from the current URL. We can redirect users to either the different web pages of the same website or another website or server. In JavaScript, a window is a global object which contains the location object. We can use the different methods of the location objects for the page redirection in ES6, which is all we learn below. Using the window.location Object’s href Attribute Value The location object of the window global object contains ... Read More

Explain non-boolean value coercion to a boolean one in JavaScript?

Rushi Javiya
Updated on 29-Dec-2022 15:00:37

382 Views

We will learn non−boolean value coercion to a Boolean one in JavaScript. For beginners, coercion word is new in JavaScript. So, let’s clarify what coercion. Coercion is converting the variable of one data type to another data type. As we all know, JavaScript is not a type−strict language. So, we don’t need to define the types of the variable. Sometimes, JavaScript automatically coerces the variables and gives unpredictable results in the output. There are two types of coercion in JavaScript. One is implicit coercion, and another is explicit coercion. We will learn both coercion one by one in this tutorial. ... Read More

FabricJS – Applying scale multiplier to a Polygon converted to a HTMLCanvasElement

Rahul Gurung
Updated on 28-Dec-2022 17:50:05

135 Views

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to convert a polygon object into HTMLCanvasElement we use the toCanvasElement method. It returns the DOM element of type HTMLCanvasElement, an interface which inherits its properties and methods from the HTMLElement interface. We use the multiplier property to set a multiplier to the ... Read More

Fabric.js – How to draw a hexagonal grid (honey comb) with Polygon class

Rahul Gurung
Updated on 28-Dec-2022 17:48:42

416 Views

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. Syntax new fabric.Polygon( points: Array, options: Object ) Parameters points − This parameter accepts an Array which denotes the array of points that make up the polygon object. options (optional) − This parameter is an Object which provides additional customizations to our object. ... Read More

Converting a polygon object into an HTMLCanvasElement using FabricJS

Rahul Gurung
Updated on 28-Dec-2022 17:44:47

114 Views

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to convert a polygon object into HTMLCanvasElement we use the toCanvasElement method. It returns the DOM element of type HTMLCanvasElement, an interface which inherits its properties and methods from the HTMLElement interface. Syntax toCanvasElement( options: Object ): HTMLCanvasElement Parameters options (optional) − ... Read More

Converting a Polygon object into a data-like URL string using FabricJS

Rahul Gurung
Updated on 28-Dec-2022 17:41:06

128 Views

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to convert a Polygon object into a data-like URL string we use the toDataURL method. This method converts an object into a data-like URL string. Syntax toDataURL(options: Object): String Parameters options (optional) − This parameter is an Object which provides additional customizations ... Read More

Adding shrink and expand animation to a Polygon object using FabricJS

Rahul Gurung
Updated on 28-Dec-2022 17:36:32

248 Views

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to add shrink and expand animation, we can use the scaleX and scaleY properties in conjunction with animate method. Syntax animate(property: String | Object, value: Number | Object): fabric.Object | fabric.AnimationContext | Array. Parameters property − This property accepts a String ... Read More

Adding rotation animation to a Polygon object using FabricJS

Rahul Gurung
Updated on 28-Dec-2022 17:30:35

289 Views

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to add rotation animation, we can use the angle property in conjunction with animate method. Syntax animate(property: String | Object, value: Number | Object): fabric.Object | fabric.AnimationContext | Array. Parameters property − This property accepts a String or Object value which determines ... Read More

Advertisements