Front End Technology Articles

Page 305 of 652

Working with HTML5 Canvas Elements using Easel.js

Mukul Latiyan
Mukul Latiyan
Updated on 15-Mar-2026 433 Views

The popularity of HTML5 Canvas elements is well-known, as they allow web developers to create animations, full-fledged applications, and interactive charts. However, working with canvas can be challenging, especially for developers coming from a Flash animation background. In this tutorial, we will explore the Easel.js library, which simplifies working with HTML5 Canvas elements. The syntax of Easel.js is similar to ActionScript and includes familiar features like Display List, Stage, and Graphics, making canvas development more accessible for Flash developers. Installing Easel.js The first step is to import Easel.js into your project. The easiest way is using the ...

Read More

Tweening and animating HTML5 and JavaScript properties with Tween.js

Mukul Latiyan
Mukul Latiyan
Updated on 15-Mar-2026 806 Views

Tween.js is a JavaScript library that is mainly used when we want to tween or animate an HTML5 or JavaScript property. It can work standalone as well as when integrated with Easel.js. In this tutorial, we will learn how we can make use of Tween.js with the help of a few examples. Before we go on to the main example, let's first discuss a few simple tweens so that when we use them in the main example, you don't get overwhelmed. Simple Tween In this tween, we will tween the alpha property of the target from 0 ...

Read More

Adding a Carousel to Your Site with Slick.js

Mukul Latiyan
Mukul Latiyan
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we will demonstrate how to use Slick.js to create responsive carousels for your websites. We'll start with a basic image carousel and then explore various customization options to enhance its functionality. If you try to create a carousel without using any libraries, it will be quite time-consuming. To reduce the effort and add multiple types of carousels with different properties, you can use Slick.js. Slick.js is a widely used jQuery plugin that allows us to create responsive carousels with multiple attributes and different properties. Features of Slick.js There are multiple reasons why Slick.js ...

Read More

Remove property for all objects in array in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 2K+ Views

Removing properties from all objects in an array is a common JavaScript task. You can accomplish this using either the delete operator (which mutates the original objects) or object destructuring with the rest operator (which creates new objects). A collection of key-value pairs constitutes an object in JavaScript. A key-value pair among them is referred to as an object property. Any data type, including Number, String, Array, Object, etc., can be used for both the keys and values of properties. Method 1: Using the delete Operator (Mutable) The delete operator removes both the property's value and the ...

Read More

Calculate the value of (m)1/n in JavaScript

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 15-Mar-2026 282 Views

In JavaScript, calculating the nth root of a number (m^(1/n)) is a common mathematical operation used in various applications. The nth root is the inverse of exponentiation - for example, the cube root of 27 is 3 because 3³ = 27. Understanding the nth Root The nth root of a number m is written as m^(1/n), where: m is the base number n is the root degree The result is the number that, when raised to the power n, equals m Syntax Math.pow(base, exponent) // For nth root: Math.pow(m, 1/n) Using ...

Read More

Calculating the area of a triangle using its three sides in JavaScript

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 15-Mar-2026 759 Views

In JavaScript, calculating the area of a triangle using its three sides can be accomplished through mathematical formulas. This is useful when you know the side lengths but not the height or base measurements. Problem Statement Create a JavaScript function that calculates the area of a triangle given the lengths of its three sides. Sample Input: Side A: 3 units Side B: 4 units Side C: 5 units Sample Output: Area: 6 Approach We'll explore two mathematical methods to solve this problem: ...

Read More

Deleting occurrences of an element if it occurs more than n times using JavaScript

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 15-Mar-2026 370 Views

In JavaScript, managing array elements with excessive occurrences is a common data manipulation task. This article demonstrates how to delete elements that appear more than a specified number of times while preserving the original order. Problem Statement Given an array and a positive integer n, write a JavaScript function that removes elements if they occur more than n times. The first n occurrences should be kept, and any additional occurrences should be removed. Sample Input: const arr = [1, 2, 3, 1, 2, 1, 1, 3]; const n = 2; Sample Output: ...

Read More

Finding the only unique string in an array using JavaScript

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 15-Mar-2026 996 Views

In JavaScript, finding a unique string that appears only once in an array is a common programming challenge. This article demonstrates two effective approaches to solve this problem. Problem Statement Write a JavaScript function that takes an array of strings as input and returns the only unique string present in the array. A unique string is defined as a string that occurs only once in the given array. If there are no unique strings, the function should return null. Sample Input: const strings = ["apple", "banana", "orange", "banana", "kiwi", "kiwi", "apple"]; Sample Output: ...

Read More

Removing all spaces from a string using JavaScript

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 15-Mar-2026 2K+ Views

JavaScript provides several efficient methods to remove all spaces from a string. This is a common requirement in web development for tasks like data validation, formatting user input, or preparing strings for processing. Problem Statement Given a string containing spaces, we need to remove all space characters to create a continuous string without any gaps. Sample Input: "Hello world! This is a test string." Sample Output: "Helloworld!Thisisateststring." Methods to Remove Spaces We'll explore four different approaches to solve this problem: Using Regular Expression with ...

Read More

Removing punctuations from a string using JavaScript

Aayush Mohan Sinha
Aayush Mohan Sinha
Updated on 15-Mar-2026 2K+ Views

Removing punctuation from strings is a common task in text processing applications. JavaScript provides several effective methods to accomplish this, from regular expressions to iterative approaches. Problem Statement Create a JavaScript function that removes all punctuation marks from a given string while preserving letters, numbers, and spaces. Sample Input: Hello, world! How's everything going? Sample Output: Hello world Hows everything going Using Regular Expression (Recommended) Regular expressions provide the most efficient way to remove punctuation. The pattern /[^\w\s]/g matches any character that isn't a word character (letters, digits) or whitespace. ...

Read More
Showing 3041–3050 of 6,519 articles
« Prev 1 303 304 305 306 307 652 Next »
Advertisements