Javascript Articles

Page 57 of 534

Explain Promise.all with async-await in JavaScript?

Rushi Javiya
Rushi Javiya
Updated on 15-Mar-2026 6K+ Views

Simple operations like adding two numbers or string manipulation codes execute sequentially in JavaScript and return the results instantly. But while coding for real-world applications, we frequently make time-taking calls to databases, APIs, and other applications. These longer calls don't return the results instantly; they will rather return a promise. A promise is an object to represent the future results of an asynchronous operation. It is used to handle asynchronous processes' eventual success or failure. For instance, if you request some object from an API in JavaScript, you will be given a promise that the task will eventually be ...

Read More

FabricJS – How to check if a Polygon Object Intersects with Another Object?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 968 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 check if a Polygon object intersects with another object, we use the intersectsWithObject method. This method checks whether the object that is passed to it, intersects with the polygon object. Syntax intersectsWithObject(other: Object, absolute: Boolean, calculate: Boolean ): Boolean ...

Read More

FabricJS – Finding the Transform Matrix that Represents the Current Transformations for a Polygon Object?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 616 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 find the transform matrix which represents current transformations, we use the calcOwnMatrix method. Syntax calcOwnMatrix(): Array Understanding Transform Matrix The transform matrix is a 6-element array that represents all transformations applied to an object: [scaleX, skewY, skewX, ...

Read More

FabricJS – Finding the current cursor position on the clicked Polygon object?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 922 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 find the current cursor position on the clicked Polygon object, we use the getLocalPointer method. Syntax getLocalPointer(e, pointer): Object Parameters e − This parameter accepts an Event which denotes the event to ...

Read More

FabricJS – Determining Whether fill or Stroke Should be Drawn First for a Polygon Object?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 270 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 determine whether fill or stroke should be drawn first, we use the paintFirst property. Syntax new fabric.Polygon( points: Array, { paintFirst: String }: Object ) Parameters points − This parameter accepts an Array ...

Read More

FabricJS – Check if the Cache is Dirty and Renderer is Required for a Polygon?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 426 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. We can check if the cache is dirty and the renderer is required by using the isCacheDirty method. This method checks whether the cache is dirty and thus lets FabricJS know that something in our canvas has changed which requires re-rendering. Syntax isCacheDirty(skipCanvas: ...

Read More

FabricJS – Check if a Polygon Object is Fully Contained within Another Object?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 614 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. We use the isContainedWithinObject method to find whether a polygon object is fully contained within the area of another object. This method returns a boolean value indicating if the polygon is completely inside the boundaries of another fabric object. Syntax isContainedWithinObject(other: Object, ...

Read More

FabricJS – Capturing the Stream of a Polygon Converted to a HTMLCanvasElement?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 383 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 captureStream method to capture stream of Polygon converted ...

Read More

FabricJS – How to identify if the given object is of a Polygon instance?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 201 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 identify if the given object is of a Polygon instance, we use the isType method. This method checks if the object is of the specified type and returns a true or false value depending on that. Syntax isType(type: String): ...

Read More

FabricJS – How to set Polygon objects properties using function instead of constructor?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 174 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 set(key: String, value: String | Boolean | Number | Object | Function) Parameters key − This parameter accepts a String which specifies the property we ...

Read More
Showing 561–570 of 5,340 articles
« Prev 1 55 56 57 58 59 534 Next »
Advertisements