Front End Technology Articles

Page 284 of 652

How to check if the value is primitive or not in JavaScript?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 3K+ Views

In JavaScript, data types are divided into two categories: primitive and non-primitive. Understanding how to check if a value is primitive is crucial for proper data handling. Primitive data types: String, number, undefined, boolean, null, symbol, and bigint. Non-primitive data types: Objects (including arrays, functions, and dates). Primitive values are immutable and represent data at the lowest level of the language. When you "change" a primitive value, you're actually creating a new value and reassigning it to the variable. Using Object() Constructor The Object() constructor converts primitive values to objects. By comparing the original value with ...

Read More

How to open a webcam using JavaScript?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 20K+ Views

In this tutorial, we will learn how to open a webcam using JavaScript. This can be accomplished using WebRTC (Web Real-Time Communication), which allows us to access and capture webcam and microphone devices on the user's system. Understanding getUserMedia() We can access the user's webcam and microphone using the navigator.mediaDevices.getUserMedia() method. This function requires user permission and returns a Promise that resolves when access is granted. Basic Implementation Steps Follow these steps to implement webcam access: STEP 1 − Create HTML elements including a video element for the webcam stream and a ...

Read More

How to call promise inside another promise in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 5K+ Views

When working with JavaScript, you may find yourself needing to call a promise inside another promise. While this may seem like a daunting task, it is actually quite simple once you understand the basics of promises. In this article, we will discuss how to call a promise inside another promise in JavaScript. The Basics of Promises In order to understand how to call a promise inside another promise, it is important first to understand the basics of promises. A promise is an object that represents the eventual result of an asynchronous operation. Promises are used in JavaScript to ...

Read More

How to invoke a function with partials prepended arguments in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 257 Views

JavaScript provides several ways to invoke functions with partial arguments prepended. This technique is particularly useful when you want to create specialized versions of existing functions or implement partial application patterns. Using the bind() Method (Recommended) The bind()

Read More

How to invoke a function with its arguments transformed in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 335 Views

In JavaScript, we can create functions that take other functions as arguments and invoke them with transformed arguments. This is a powerful technique that can be used to create higher-order functions, which can take a function and return a new function with different behavior. What are Transforming Function Arguments To transform function arguments, we can use several approaches including the built-in methods map() and reduce(), or create custom transformation functions. These methods can be used on arrays to transform the elements in the array, and we can use them on functions to transform the arguments that are passed ...

Read More

How to create Expanding Cards using HTML, CSS, and JavaScript

Imran Alam
Imran Alam
Updated on 15-Mar-2026 3K+ Views

In this tutorial, we will learn how to create Expanding Cards using HTML, CSS and JavaScript. Expanding cards provide an interactive way to display content with smooth animations and enhanced user experience. What are Expanding Cards? Expanding cards are interactive UI elements that scale up or reveal additional content when clicked. They are commonly used to display information in a compact format while providing an engaging way to access more details on demand. HTML Structure To create expanding cards, we need the following HTML elements: Card container element: Contains all cards ...

Read More

How to create Frame by Frame Animation using CSS and JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 971 Views

Frame by frame animation is a technique used in animation to produce motion by displaying a series of static images which are sequentially displayed. The appearance of motion is achieved by displaying the images in rapid succession. The followings are needed before we go to create the frame by frame animation: A series of images (frames) A web page with CSS and JavaScript Approach The process of creating frame by frame animation using CSS and JavaScript is relatively simple: STEP 1 – First, you need to create ...

Read More

How to Flatten JavaScript objects into a single-depth Object?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 3K+ Views

In JavaScript, flattening an object means converting a nested object structure into a single-depth object where all nested properties are brought to the top level with flattened key names. What is Object Flattening? Object flattening transforms a multi-level nested object into a flat structure. For example, an object like {a: 1, b: {c: 2, d: 3}} becomes {a: 1, "b.c": 2, "b.d": 3} or {a: 1, c: 2, d: 3} depending on the flattening strategy. Method 1: Simple Flattening (Merging Properties) This approach merges nested properties directly into the parent object: ...

Read More

How to unflatten an object with the paths for keys in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 520 Views

In JavaScript, unflattening an object means converting a flattened object (where nested properties are represented as dot-separated keys) back to its original nested structure. This is commonly needed when working with APIs, databases, or form data that store nested objects as flat key-value pairs. What is a Flattened Object? A flattened object has nested properties represented as string keys with dot notation: // Flattened object var flatObj = { "user.name": "John", "user.age": 30, "user.address.city": "New York", "user.address.zip": "10001" }; Basic Unflattening Algorithm ...

Read More

What are Architecture Flux Components in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 585 Views

Flux is a JavaScript application architecture pattern developed by Facebook for building scalable web applications. Originally designed for React applications, Flux provides a unidirectional data flow pattern that makes application state more predictable and easier to debug. The Flux architecture consists of four main components that work together to manage data flow in a predictable way. Core Flux Components Flux architecture is built around four key components that ensure unidirectional data flow: Actions − Plain JavaScript objects that describe what happened in the application Dispatcher − Central ...

Read More
Showing 2831–2840 of 6,519 articles
« Prev 1 282 283 284 285 286 652 Next »
Advertisements