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 137 of 652
Working with Excel Files using Excel.js
Excel.js is a powerful Node.js library for reading, manipulating, and writing Excel files. It supports both XLSX and CSV formats, making it ideal for data processing applications. Installation To install Excel.js in your Node.js project, run the following command: npm install exceljs Once installed, you can start working with Excel files programmatically. All examples in this tutorial work with XLSX (Open XML Spreadsheet) files. Working with Excel Cells The getCell() method allows you to access individual cells by reference or coordinates. Here's how to read cell values: const Excel = ...
Read MoreJavaScript Program to Find Longest Common Prefix Using Word by Word Matching
Prefixes are substrings that start from the zeroth index of a string and can be of any size from 1 to the complete length of the string. We are given a set of strings and need to find the longest common prefix among all of them using JavaScript. We'll implement word-by-word matching approach where we compare characters at the same position across all strings. Input arr = ["zefkefgh", "zefkdefij", "zeffdzy", "zefkdabacd"]; Output zef Explanation From all the given strings, the first three ...
Read MoreHow to create and download CSV file in JavaScript?
JavaScript provides powerful capabilities to manipulate data and handle various file formats. When developing web applications, you often need to export data as CSV files for users to download - such as order details from e-commerce platforms or transaction records from banking applications. In this tutorial, we will learn to create CSV files from JavaScript data and automatically download them to the user's device. Syntax The basic approach involves converting data to CSV format and using a virtual anchor element for download: // Convert data to CSV format let csvData = 'Header1, Header2, Header3'; data.forEach(function ...
Read MoreHow to create bar chart in react using material UI and Devexpress?
Material UI is a popular React UI library that provides pre-styled components for building modern applications. DevExpress offers the 'dx-react-chart-material-ui' package that seamlessly integrates Material UI styling with powerful charting capabilities. This tutorial demonstrates how to create various types of bar charts using DevExpress charts with Material UI styling in React applications. Prerequisites Install the required packages using these commands: npm install @mui/material @emotion/react @emotion/styled npm install @devexpress/dx-react-chart @devexpress/dx-react-chart-material-ui Basic Syntax The basic structure for creating a DevExpress bar chart with Material UI: ...
Read MoreImplode an array with jQuery/JavaScript
In JavaScript and jQuery, "imploding" an array means joining its elements into a single string. This is commonly needed when displaying lists, generating SQL queries, or creating comma-separated values. We'll explore 4 different approaches to join array elements into strings. Using the Array.join() Method (Recommended) The join() method is the most efficient way to implode an array. It joins all elements into a string with a specified delimiter. Syntax array.join(delimiter) The delimiter parameter is optional. If omitted, elements are separated by commas. Example: Basic Join ...
Read MoreWhat are the restrictions of web workers on DOM in JavaScript?
JavaScript is a single-threaded programming language, executing all code step-by-step. For computationally intensive tasks like processing large datasets, this can cause performance bottlenecks and poor user experience. Web workers provide a solution by running tasks in background threads, but they have strict limitations when it comes to DOM access. Web workers operate in a separate thread context, isolated from the main thread for security and performance reasons. This isolation creates several important restrictions when working with DOM elements. Key DOM Restrictions of Web Workers 1. No Direct DOM Access Web workers cannot access DOM elements directly. ...
Read MoreHow to create a slider to map a range of values in JavaScript ?
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 MoreHow to create a Switch in ReactJS?
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 MoreHow to create Tabs in ReactJS ?
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 MoreHow to Declare Constants in React Class?
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