Articles on Trending Technologies

Technical articles with clear explanations and examples

How to set the edit mode of Textbox using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we are going to learn how to enable the edit mode of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also edit the text in our Textbox. This can be enabled or disabled by using the editable property. Syntax new fabric.Textbox(text: String, { editable : Boolean }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. ...

Read More

How to check if the IText object has stroke using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 228 Views

In this tutorial, we are going to learn about how to check if the IText object has stroke using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is not true for ...

Read More

Difference between document load and DOMContentLoaded events in JavaScript

Manisha Patil
Manisha Patil
Updated on 15-Mar-2026 3K+ Views

In JavaScript, understanding when to use DOMContentLoaded versus load events is crucial for optimal web performance. Both events help determine when different parts of a webpage have finished loading, but they trigger at different stages of the loading process. DOMContentLoaded Event The DOMContentLoaded event fires when the HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. This makes it ideal for DOM manipulation scripts that don't depend on external resources. Syntax document.addEventListener("DOMContentLoaded", function(e) { console.log("DOM is ready"); }); Example: DOMContentLoaded Event ...

Read More

Explain Passport in Node.js?

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

Passport is a popular Node.js authentication middleware that provides flexible authentication strategies. It handles user authentication, password encryption, and session management with minimal code complexity. Passport offers over 500 authentication strategies including local authentication, OAuth (Google, Facebook), JWT tokens, and more. It integrates seamlessly with Express.js and popular databases like MongoDB. Key Features Authentication Strategies: Passport supports multiple authentication methods through strategy plugins. The most common is passport-local for username/password authentication. Password Security: Automatically handles password hashing and verification using secure algorithms, protecting user credentials from being stored in plain text. Session Management: Maintains user ...

Read More

How to convert JSON results into a date using JavaScript?

Saurabh Jaiswal
Saurabh Jaiswal
Updated on 15-Mar-2026 8K+ Views

JSON is a powerful data format to exchange data from server to client and vice versa. Many times JSON data is received in a String format and we need to convert it to a usable JSON object. In this process, it's an important requirement to convert string data into Date format. In this article, we will learn how to convert JSON results into a Date string using JavaScript. The JSON objects contain the date like this − { name: "John", time: '/Date(1559072200000)/' } And the result will be − ...

Read More

Group strings starting with similar number in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 327 Views

In JavaScript, you can group strings that start with the same number by extracting the first part before the decimal and comparing consecutive elements. This is useful when working with version numbers, decimal classifications, or any structured string data. Problem Statement Given an array of number strings like this: const arr = ["1.1", "1.2", "1.3", "2.1", "2.2", "3.1", "3.2", "3.3", "4.1", "4.2"]; console.log("Input array:", arr); Input array: [ '1.1', '1.2', '1.3', '2.1', '2.2', '3.1', '3.2', '3.3', '4.1', '4.2' ] We need to group all strings starting with the same number into ...

Read More

Recursion example in JavaScript to display numbers is descending order?

Nikhilesh Aleti
Nikhilesh Aleti
Updated on 15-Mar-2026 1K+ Views

In this article, we will display numbers in descending order using recursion in JavaScript. Recursion is a programming technique where a function calls itself to solve smaller instances of the same problem. Input-Output Scenario Let's look at an input-output scenario where we need to print numbers in descending order from a given number to 1: Input = 10 Output = 10 9 8 7 6 5 4 3 2 1 What is Recursion? The process of a function calling itself is called recursion. The function which calls itself is known as a recursive ...

Read More

Convert 2d tabular data entries into an array of objects in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 241 Views

Converting 2D tabular data into an array of objects is a common requirement when working with datasets. This transformation groups rows by a unique identifier and creates objects with dynamic properties. Problem Overview Suppose we have an array of arrays representing tabular data: const arr = [ ["Ashley", "2017-01-10", 80], ["Ashley", "2017-02-10", 75], ["Ashley", "2017-03-10", 85], ["Clara", "2017-01-10", 90], ["Clara", "2017-02-10", 82] ]; We need to transform this into an array of objects where each unique name becomes a ...

Read More

Split a range of number to a specific number of intervals JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 15-Mar-2026 3K+ Views

In this problem statement, our task is to write a function that splits a range of numbers into a specific number of intervals using JavaScript. We need to provide the start value, end value, and the number of intervals. Understanding the Problem The problem requires creating a function that divides a numerical range into equal intervals. The inputs are the starting number, ending number, and desired number of intervals. The output should be an array of subarrays, where each subarray represents an interval with its start and end values. For example, if the range is from 0 ...

Read More

Finding the largest and smallest number in an unsorted array of integers in JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 15-Mar-2026 6K+ Views

In JavaScript, finding the largest and smallest numbers in an unsorted array is a common programming task. We can efficiently solve this using a linear scan approach without sorting the entire array. Understanding the Problem Given an unsorted array of integers, we need to find both the minimum and maximum values. For example, in the array [11, 21, 14, 32, 20, 12], the smallest number is 11 and the largest is 32. The challenge is to find these values efficiently without sorting the array first. Method 1: Linear Scan Approach The most straightforward approach uses a ...

Read More
Showing 15051–15060 of 61,297 articles
Advertisements