Javascript Articles

Page 54 of 534

How to create and download CSV file in JavaScript?

Rushi Javiya
Rushi Javiya
Updated on 14-Jul-2023 6K+ Views

JavaScript has great capability to manipulate various data and handle them with files of different formats. Sometimes, developers require to handle the data with the CSV file while developing web applications using JavaScript. For example, we are building an e-commerce platform where users can buy and sell products. Also, we want to allow users to download their order details according to the time horizon into the CSV file. We need to interact with the data and CSV files in such cases. Another example is online banking sites allow us to download the transaction details in CSV files. In this ...

Read More

Difference Between textContent and innerHTML

Pradeep Kumar
Pradeep Kumar
Updated on 13-Jul-2023 636 Views

There are various methods used in web development to change the text or add additional elements to an HTML element's content. TextContent and innerHTML are two frequently used properties for changing an HTML element's content. Although these two qualities might appear to be identical, they have distinct behaviours and applications. The text content of an element and all of its descendants can be set or retrieved using the textContent attribute. Without any HTML tags, it merely provides the text information. In contrast, the innerHTML property sets or retrieves an element's HTML content, including all HTML tags and their associated ...

Read More

Difference Between String Slice and Substring Methods

Pradeep Kumar
Pradeep Kumar
Updated on 13-Jul-2023 2K+ Views

JavaScript is a dynamic and most popular programming language which can be used on both client side and server side. JavaScript is used to create interactive web pages. It has many frameworks such as React JS, Angular JS, Node JS etc., JavaScript contains many inbuilt functions to perform various tasks. There are functions that are used to manipulate the strings. Str.slice and str.substring are two of those inbuit functions that can manipulate strings. Although the functionalities of both the functions are almost similar, there are a few differences between them String.slice() Method This method returns a part of the string ...

Read More

JavaScript Program to Find Minimum Insertions to Form a Palindrome

Prabhdeep Singh
Prabhdeep Singh
Updated on 12-Jul-2023 293 Views

We are given a string and we have to find the minimum number of different character that we need to insert in the given string at any place so that the final string will be palindrome. A palindrome is a string that is just equal to the reverse of it. This problem is of dynamic programming, so we will first go for the recursive approach, then we will memorize it, and at the end we will see the tabulation of the memorization approach. Recursive ApproachExample const max = 1e5; // defining the upper limit // function to ...

Read More

JavaScript Program to Find Longest Common Prefix Using Word by Word Matching

Prabhdeep Singh
Prabhdeep Singh
Updated on 12-Jul-2023 421 Views

Prefixes are the substrings that start from the zeroth index of the given string and can be of any size from 1 to the complete length of the string. We are given a set of strings and we have to find the common prefix among all of them in the JavaScript programming language. We have to implement the word-by-word matching approach in which we will match the words instead of the complete strings. Input arr = ["zefkefgh", "zefkdefij", "zeffdzy", "zefkdabacd"]; Output zef Explanation From all the given strings, we have the first three characters, the same and the remaining ...

Read More

How to Run Javascript from Python?

Rohan Singh
Rohan Singh
Updated on 11-Jul-2023 10K+ Views

In Python, we can run Javascript using the PyExecJS library or the js2py library of Python. 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 the PyExecJS library. Method 1: Using the PyExecJS library The PyExecJs library provides a simple interface for executing JavaScript code. It allows developers ...

Read More

Difference between indexOf and findIndex Function

Pradeep Kumar
Pradeep Kumar
Updated on 03-Jul-2023 888 Views

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
Pradeep Kumar
Updated on 03-Jul-2023 2K+ Views

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

Adding a Carousel to Your Site with Slick.js

Mukul Latiyan
Mukul Latiyan
Updated on 26-Jun-2023 1K+ Views

In this tutorial, we will demonstrate how you can use Slick.js to work with carousels and then add them to your websites. We will start with creating a simple carousel of images with the basic scroll being available to us and then slowly we will make some changes to the carousel by adding different properties to our carousel according to our needs. If you try to create a carousel without using any libraries, it will be quite time consuming. To reduce the efforts and to be able to add multiple types of carousel with different properties, ...

Read More

Difference between == and === operator in JavaScript

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 23-Jun-2023 9K+ Views

JavaScript is widely used to create interactive web pages. It has many frameworks such as React JS, Angular JS, Node JS, etc. Like any other programming language, JavaScript also provides operators like arithmetic, relational, comparison operators, etc. The equality operator, i.e., "==" is one such comparison operator that checks whether the LHS is equal to RHS or not. This operator is present in all other programming languages but it is somewhat different in JavaScript. This is due to the fact that JavaScript is a loosely typed language, whereas all other languages are strictly typed. As JS is loosely typed, it ...

Read More
Showing 531–540 of 5,338 articles
« Prev 1 52 53 54 55 56 534 Next »
Advertisements