Articles on Trending Technologies

Technical articles with clear explanations and examples

How to lock the flipping during scaling of Triangle using FabricJS?

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

In this tutorial, we are going to learn how to lock the flipping during scaling of a triangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a triangle object in the canvas, we can also specify whether we want to stop flipping an object during scaling. This can be done by using the lockScalingFlip property. Syntax new fabric.Triangle({ lockScalingFlip : Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our triangle. Using this parameter, properties ...

Read More

How to get the left boundary of a word in IText using FabricJS?

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

In this tutorial, we are going to learn about how to get the left boundary of a word in IText 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 ...

Read More

How to Create a Binary Calculator using HTML, CSS and JavaScript?

Saurabh Anand
Saurabh Anand
Updated on 15-Mar-2026 2K+ Views

A binary calculator is a program that performs mathematical calculations on binary numbers. Binary numbers consist of only two digits: 0 and 1. In this tutorial, we'll create a functional binary calculator that can perform addition, subtraction, multiplication, and division operations using HTML for structure, CSS for styling, and JavaScript for functionality. HTML Structure First, let's create the HTML structure with a form containing a display field and buttons for binary digits and operations: Binary Calculator ...

Read More

Iterate over an object and remove false property in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

In JavaScript, you may need to recursively iterate through an object and remove properties with falsy values. This is common when cleaning up configuration objects or filtering data structures. The Problem Consider an object with nested structures containing "enabled" properties. We want to remove any objects where enabled is false, and also clean up any empty parent objects left behind. const obj = { a: { someKey: { propOne: '', ...

Read More

Getting the return value of Javascript code in Selenium.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 15-Mar-2026 4K+ Views

We can get the return value of Javascript code with Selenium WebDriver using the executeScript method. This method executes JavaScript commands in the browser and can return values back to our Java code. To work with JavaScript in Selenium, we need to cast our WebDriver instance to JavascriptExecutor and import the necessary package. The JavaScript command is passed as a string argument to the executeScript method. Syntax JavascriptExecutor js = (JavascriptExecutor) driver; Object result = js.executeScript("return document.getElementById('elementId').value"); Key Points When working with JavaScript return values in Selenium: Use the return keyword ...

Read More

Checking for overlapping times JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 3K+ Views

Time interval overlap detection is a common programming challenge. We need to determine if any two time intervals in an array share common time periods. Problem Definition Given an array of time intervals with start and end times, we need to check if any two intervals overlap. Two intervals overlap when they have some time in common. const arr = [ { start: '01:00', end: '04:00' }, { start: '05:00', end: '08:00' }, { start: '07:00', end: '11:00' }, { start: '09:30', end: '18:00' ...

Read More

Round number down to nearest power of 10 JavaScript

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

In JavaScript, rounding down a number to the nearest power of 10 involves finding the highest power of 10 that is less than or equal to the given number. For example, 1365 rounds down to 1000, and 987 rounds down to 100. Understanding the Problem The task is to create a function that rounds down any given number to the nearest power of 10. Powers of 10 are numbers like 1, 10, 100, 1000, etc. For a number like 1365, the nearest lower power of 10 is 1000, while for 87, it would be 10. Algorithm ...

Read More

Checking if one string can be achieved from another with single tweak in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 145 Views

We are required to write a JavaScript function that takes in two strings of characters lets call them str1 and str2. The function should check whether we can form str2 from str1 by deleting exactly one character from str1. If we can do so the function should return true, false otherwise. For example − If the input strings are − const str1 = 'chemistty'; const str2 = 'chemisty'; Then the output should be − const output = true; Approach The solution involves checking if the length difference is ...

Read More

Removing least number of elements to convert array into increasing sequence using JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 196 Views

We need to write a JavaScript function that removes the minimum number of elements from an array to make it strictly increasing. This is essentially finding the Longest Increasing Subsequence (LIS) and removing all other elements. Problem Analysis The goal is to find the longest possible increasing subsequence and remove the fewest elements. A strictly increasing sequence means each element is greater than the previous one. Example with Corrected Algorithm The original approach has flaws - it doesn't find the optimal solution. Here's a correct implementation using dynamic programming: const arr = [1, 100, ...

Read More

How to lock the rotation of a Circle using FabricJS?

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

In this tutorial, we are going to learn how to lock the rotation of a Circle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a circle object in the canvas, we can also specify whether we want it to rotate or not. This can be done by using the lockRotation property. Syntax new fabric.Circle({ lockRotation : Boolean }) Parameters options (optional) − This parameter is an Object which provides additional customizations to our circle. Using this parameter, ...

Read More
Showing 11681–11690 of 61,303 articles
Advertisements