Rohan Singh

Rohan Singh

144 Articles Published

Articles by Rohan Singh

144 articles

How to create a slider to map a range of values in JavaScript ?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 1K+ Views

In JavaScript, mapping a range of values to another range of values can be achieved through various approaches. One common method is by using a slider. A slider allows users to interactively select a value within a specified range and display the mapped value in real-time. In this article, we will explore how to create a slider in JavaScript and map a range of values from (0-100) to (100-10, 000, 000). Steps to create a Slider to map a range of Values in Javascript Step 1: HTML Structure First, we need to set up the HTML structure ...

Read More

How to create a Responsive Admin Dashboard using HTML CSS & JavaScript ?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 10K+ Views

An admin dashboard provides important data insights and controls for managing various aspects of an application or website. In this article, we will explore the process of creating a responsive admin dashboard using the three pillars of web development: HTML, CSS, and JavaScript. Prerequisites To follow this article, you should have a basic understanding of HTML, CSS, and JavaScript. Familiarity with concepts like responsive design, CSS Flexbox, and CSS Grid will also be helpful. Step 1: Setting Up the HTML Structure We'll start by setting up the basic HTML structure for our admin dashboard. Create a ...

Read More

How to create a Switch in ReactJS?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 2K+ Views

ReactJS is a popular JavaScript library for building user interfaces, and it provides an effective approach to developing interactive components. Toggle switches are frequently used to allow users to switch between dark mode and light mode themes in web applications. Toggle switches can also be used to show or hide specific content or sections of a page. In this article, we will explore how to create a toggle switch using ReactJS. Prerequisites Before proceeding with this tutorial, it is assumed that you have a basic understanding of ReactJS and have a development environment set up with Node.js and npm ...

Read More

How to Create a Time Picker in ReactJS ?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 1K+ Views

ReactJS is a popular JavaScript library for building user interfaces. It provides developers with a flexible and efficient way to create interactive web applications. Time pickers are commonly used in applications where users need to select a specific time slot for booking appointments, scheduling events, or reserving resources. A time picker allows users to easily select the desired time and ensures accurate time allocation. In this article, we will create a time picker in steps using ReactJS. Setting Up the React App First, let's set up a ...

Read More

How to create Tabs in ReactJS ?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 1K+ Views

ReactJS is a popular JavaScript library for building user interfaces. It provides a component-based approach to web development, making it easier to create interactive and dynamic UI elements. Tabs are a common UI pattern used to organize and present content in a user-friendly manner. In this article, we will explore how to create a tab component in ReactJS. Prerequisites Before reading this article, you should have a basic understanding of ReactJS and its core concepts. Make sure you have Node.js and npm (Node Package Manager) installed on your machine. Setting up a new React project First, ...

Read More

How to Declare Constants in React Class?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 3K+ Views

When developing applications with React, it's necessary to declare constants to store values that remain unchanged throughout the lifecycle of a component or application. Constants can help improve code readability, provide a central location for managing shared values, and enhance maintainability. In this article, we'll explore how to declare constants in a React class component. Importing React To begin, let's assume you have set up your React environment and have a class component ready for use. Before declaring constants, make sure you have imported the necessary libraries. This includes importing React, which is the core library for building ...

Read More

How to delay a loop in JavaScript using async/await with Promise?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 3K+ Views

Some time−consuming tasks are executed without blocking the main thread in Asynchronous programming. In certain cases, developers may need to delay the execution of a loop to control the flow of their program or introduce delays between iterations. JavaScript provides several techniques for delaying execution, and in this article, we will explore how to delay a loop using the combination of async/await and Promises. Understanding async/await The async/await syntax was introduced in ECMAScript 2017 (ES8) and provides a concise and readable way to write asynchronous code. It is built on top of Promises and allows developers to write ...

Read More

How to Run Javascript from Python?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 10K+ Views

In Python, we can run Javascript using the PyExecJS library or the js2py library. The PyExecJS library provides a consistent API for running JavaScript code from within Python using a variety of JavaScript engines, including Node.js, JavaScriptCore, and Google's V8 engine. The js2py library allows you to execute JavaScript code from within Python by parsing the JavaScript code and interpreting it in Python. This article will teach us how to run JavaScript from Python using these libraries. Method 1: Using PyExecJS Library PyExecJS provides a simple interface for executing JavaScript code. It allows developers to seamlessly integrate JavaScript ...

Read More

How to Select a Random Element from Array in JavaScript?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 4K+ Views

To select a random element from array in JavaScript, means getting any random element from the given array. We will understand various approaches for selecting a random element from array. In this article, we are having an array and our task is to select a random element from array in JavaScript Approaches to Select a Random Element from Array Here are the most effective approaches to select a random element from array in JavaScript which we will be discussing in this article with stepwise explanation and complete example codes. Using Math.random() ...

Read More

How to select all text in HTML text input when clicked using JavaScript?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 7K+ Views

In web development, it is often necessary to provide users with an intuitive and convenient way to select all text within an HTML text input field when they click on it. This feature can greatly enhance user experience, especially when dealing with lengthy or pre-filled input fields. In this article, we will explore how to achieve this functionality using JavaScript. What does Selecting All Text in HTML Text Input Mean? When a user clicks on an HTML text input field, we want the entire text within that field to be automatically selected, allowing the user to easily modify ...

Read More
Showing 1–10 of 144 articles
« Prev 1 2 3 4 5 15 Next »
Advertisements