Found 6915 Articles for Javascript

Difference between indexOf and findIndex Function

Pradeep Kumar
Updated on 03-Jul-2023 16:21:02
JavaScript is a dynamic programming language which can be used on both client side and server side. JavaScript is used to create interactive webpages. It has many frameworks such as React JS, Angular JS, Node JS etc. JavaScript provides some methods using which the index of the specified element can be obtained. indexOf and findIndex are those methods. The indexOf Function in JavaScript The indexOf function in JavaScript allows us to search for an element in an array and returns the first found index in that array. If it can't find the element, then -1 is returned. The syntax of ... Read More

Difference between GET and POST Request in JavaScript

Pradeep Kumar
Updated on 03-Jul-2023 16:14:50
HTTP requests are frequently used in web development to send and receive data from a server. GET and POST queries are two of the most frequently utilised HTTP requests. It is crucial for web developers to comprehend the distinctions between these two request kinds if they wish to build apps that are both secure and effective. GET and POST requests serve different functions and have different properties. Data can be retrieved from a server using GET queries and submitted to a server using POST requests. POST requests are used for requests that alter or generate data on the server, whereas ... Read More

Working with Excel Files using Excel.js

Mukul Latiyan
Updated on 22-Jun-2023 17:26:03
In order to work with the Excel.js, you need to first install the package as a dependency in your project. To install Excel.js in your project, you need to run the following command − npm install exceljs Once you run the above command, Excel.js will be installed as a dependency in your project. In all the examples used in this tutorial, we will work with "xlsx" files that are open XML spreadsheet files used in Microsoft Excel. Working on ExcelJS Cells In the example shown below, we are working with Excel sheet cells. To get a reference of a ... Read More

How to Scrape a Website using Puppeteer.js?

Mukul Latiyan
Updated on 22-Jun-2023 13:32:43
Web scraping is one of the best ways in which one can automate the process of data collection from the web. Normally we refer to a web scraper as a "crawler" who simply surfs the web and then gives us the scraped data from the pages that we selected. There are many reasons for automating the data scraping process as it is much easier than the process of manually extracting the data from different web pages. Scraping is also a very good solution when the web page that we want to extract the data from doesn't provide us with any ... Read More

How to Bundle up JavaScript Files using Rollup.js?

Mukul Latiyan
Updated on 22-Jun-2023 13:27:54
In this tutorial, we will understand how to use rollup.js to bundle JavaScript files. Before we do that, the first step is to get familiar with the JavaScript module bundler called Rollup, which compiles the files of multiple sources into a single bundle. Rollup is similar to webpack and Browserify. It is more popular than many of the other bundlers out there because of its ability to keep the files small even after bundling them into a single unit. There are multiple features that Rollup brings to the table, some of them are mentioned below − Development is ... Read More

How to Build a REST API with Fastify?

Mukul Latiyan
Updated on 22-Jun-2023 13:21:46
Fastify is a framework that is mainly designed to do backend development in JavaScript. It is one of the lightest backend framework that one can work with, and it is one of the main reasons why it is preferred if you want to avoid the heavier node frameworks like Express and Hapi. Since its inception, multiple versions of Fastify have been released. In the latest version, we get the capability to even verify the incoming and outgoing requests as well as the request parameters. It might not come as a surprise that the people who developed Fastify claim that it ... Read More

Creating a Progress Bar using JavaScript

Prince Yadav
Updated on 29-May-2023 14:34:57
JavaScript is a powerful language that allows web developers to create dynamic and interactive web pages. It can be used to add a wide range of features to a website, such as a form validation, animation, and more. One of the most useful features that JavaScript can be used for is creating a progress bar. In this tutorial, we will walk you through the process of creating a progress bar using JavaScript. A progress bar is a graphical representation of the progress of a task, and can be used to give the user feedback on how long a task will ... Read More

Detect the Operating System of User using JavaScript

Prince Yadav
Updated on 18-May-2023 15:39:43
JavaScript is a versatile and dynamic programming language that has become an indispensable part of the web development world. Its ease of use and ability to bring interactivity to websites has made it incredibly popular among developers. JavaScript is capable of creating a wide range of applications, from simple interactive elements on websites to complex web-based applications. In this tutorial, we're going to show how you can use JavaScript features to find out what operating system your website visitors are using. Knowing this information can be very useful in giving them a customized experience. You can change the look of ... Read More

Detect Whether a Device is iOS or Not Using JavaScript

Prince Yadav
Updated on 18-May-2023 15:33:46
JavaScript is a high-level, interpreted programming language that is widely used for developing dynamic and interactive web applications. Its versatility and ease of use have made it one of the most popular programming languages in the world. In this tutorial, we'll explore how to use JavaScript to detect whether a device is running iOS or not. Knowing the type of device your users are accessing your web application from is crucial as a software developer. This information can be used to provide a better user experience or to customize the layout and functionality of your web application. In this section, ... Read More

How to replace an HTML element with another one using JavaScript?

Shubham Vora
Updated on 17-May-2023 12:45:45
In this tutorial, we will learn to replace an HTML element with another one using JavaScript. In some use cases, we require to replace a whole HTML element with a different one. For example, it is very important in the form validation. Suppose we are taking the user’s age from the form, and the user enters the wrong age; we can show the validation message by replacing the HTML element. Another use case where we require to replace an HTML element with another one is dynamic content loading, in which we must show the web page content based on certain ... Read More
1 2 3 4 5 ... 692 Next
Advertisements