Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Front End Technology Articles
Page 283 of 652
How to get an object containing parameters of current URL in JavaScript?
JavaScript provides several ways to extract URL parameters from the current page or any URL. This is useful for handling query strings, routing, and dynamic content based on URL parameters. Using the Location Object The easiest way to get information about the current URL is to use the Location object. This object is a property of the window object and contains information about the current URL. // Get the entire URL var ...
Read MoreHow to Design a Calculator with Neumorphism Effect/Soft UI in JavaScript?
In this tutorial, we will create a calculator using JavaScript with a neumorphic effect, also known as soft UI. Neumorphism is a modern design trend characterized by soft, rounded edges and subtle inset/outset shadows that create a tactile, embossed appearance. What is Neumorphism? Neumorphism combines elements of skeuomorphism and flat design. It creates depth through subtle shadows and highlights, making UI elements appear to be extruded from or pressed into the background surface. Planning the Calculator Layout Our calculator will include: Two input fields for entering numbers One output field to display results Operation ...
Read MoreWhat are the attributes that work differently between React and HTML?
React and HTML handle attributes differently, which can cause confusion for developers. While HTML attributes are always strings, React treats some attributes as JavaScript expressions and has specific naming conventions that differ from standard HTML. Key Differences in Attribute Handling The main differences between React and HTML attributes include: Naming Convention: React uses camelCase (onClick) vs HTML's lowercase (onclick) JavaScript Expressions: React attributes can accept JavaScript functions and expressions Special Attributes: Some HTML attributes have different names in React Boolean Handling: React handles boolean attributes differently than HTML Event Handler Attributes React event ...
Read MoreHow to design a video slide animation effect using HTML CSS JavaScript?
In this tutorial, we will learn how to create a captivating video slide animation effect using HTML, CSS, and JavaScript. This animation makes a video element slide smoothly across the screen, creating an engaging visual effect for web applications. Understanding CSS Keyframes The foundation of our animation is CSS keyframes. A keyframe rule defines how CSS properties change over time during an animation. For our sliding video, we'll use the transform property with translateX() to move the video horizontally. @keyframes slide { from { transform: translateX(-100%); ...
Read MoreHow to clone a given regular expression in JavaScript?
JavaScript's regular expression support is widely considered to be among the best in the world, but there's one area where it's lacking: there's no built-in way to clone a regular expression. This can be a problem when you need to create a new regular expression that is similar to an existing one but with a few small changes. The problem is that regular expressions are objects, and when you assign one regex to another variable, both variables reference the same object in memory. The Problem with Direct Assignment let regex1 = /foo/g; let regex2 = regex1; ...
Read MoreHow to uncurry a function up to depth n in JavaScript?
In JavaScript, a function is considered "curried" if it takes one or more arguments and returns a new function that expects the remaining arguments. Currying is a powerful technique that can be used to create new functions from existing ones, or to "uncurry" a function up to depth n. Why do we uncurry a function? There are several reasons why you might want to uncurry a function. For example, you may want to − Use a curried function in a context where a non-curried function is expected Convert ...
Read MoreHow to truncate an array in JavaScript?
This tutorial is going to be about truncating an array in JavaScript. Truncating an array means trimming some elements from the end and assigning back the new value of the truncated array to the actual array. Sometimes we need to truncate an array. For example, if there is an array with sorted elements in descending order, and we need only the first k sorted elements from the array. Instead of creating an extra array and modifying that, we can directly truncate the original array. There are several ways to truncate an array. Let's explore these methods. Syntax ...
Read MoreWhat are the different use cases of remainder operator (%) in JavaScript?
In this tutorial, we will explore the different use cases of the remainder operator (%). The % operator returns the remainder when one number is divided by another and takes the sign of the dividend (the first operand). What is Remainder? When dividing two numbers, if the dividend is not completely divisible by the divisor, there is always a remainder. The remainder is what's left over after the division. 10 ÷ 2 = 5 (remainder 0, completely divisible) 6 ÷ 4 = 1 (remainder 2, not completely divisible) The remainder operator works as: dividend ...
Read MoreHow to create a string by joining the elements of an array in JavaScript?
In this tutorial, we will see how to create a string by joining the elements of an array in JavaScript. We will explore two different approaches: using the addition operator (+) to manually concatenate elements, and using the built-in join() method, which is the recommended approach. Using the Addition Operator (+) In this approach, we manually loop through the array and concatenate each element with a separator using the addition operator. While this works, it's more verbose than using the built-in join() method. Algorithm STEP 1 − Create an array with ...
Read MoreHow to create an element from a string in JavaScript?
In this tutorial, we will explore various methods to create HTML elements from strings in JavaScript. Creating elements dynamically from strings is essential for building interactive websites, such as to-do list apps where items are added, deleted, and edited on the fly. Using createElement() Method The createElement() method is the standard way to create HTML elements dynamically in JavaScript. This method takes a string parameter representing the tag name and returns a new HTML element. Syntax document.createElement(tagName) Where tagName is a string representing the HTML tag (like "div", "p", "h1", "img"). The method ...
Read More