Found 10483 Articles for Web Development

Creating a Dynamic Report Card using HTML, CSS, and JavaScript

Mayank Agarwal
Updated on 25-Apr-2022 11:19:44

5K+ Views

In this article, we are going to build a dynamic report using the inputs entered by the user. The user will enter the marks (in this case) and we will be populating these marks to calculate the final percentage of the student.We have also implemented the fail/pass status that will render whether a student has passed or failed based upon the entries done by the user. We will be using HTML, CSS, and JavaScript for the implementation.StepsWe will be creating an HTML template with rows and columns for name and subject scores. These subject scores will be further divided into ... Read More

How to create a "Coming Soon" page using JavaScript?

Mayank Agarwal
Updated on 22-Apr-2022 14:11:17

330 Views

In this article, we will be creating a Coming Soon Page that will display a timer for the event that will occur on a specific date and time. The timer will go in the opposite direction and at the time of the actual event, it will basically show the event page if configured.A coming soon is similar to a webpage with some special specifications to show. The specifications define what is next to come to the website (Like a launch of a new Smartphone, Feature, TV, Software, Tool, etc.)ApproachWe will first set up a page to be displayed on the ... Read More

How to convert a string of any base to an integer in JavaScript?

Mayank Agarwal
Updated on 22-Apr-2022 14:05:55

502 Views

An integer can be represented in various formats as described in the computed languages i.e. Binary, Decimal, Hexadecimal, etc. A Binary number consists of two digits only i.e. 0 & 1, whereas a decimal consists of digits from 0 to 9.We can convert a string to an integer by using the parseInt() conversion by default. But in other cases when the integer is represented in some other form we also need to pass the base string to decode it into the resultant number.Below is the syntax of parsing a string to an int.Syntax1. When the base value is providedparseInt(string_value, base)2. ... Read More

JavaScript: Converting a CSV string file to a 2D array of objects

Mayank Agarwal
Updated on 26-Dec-2024 20:46:20

764 Views

A CSV is a comma-separated value that is stored in a file with the .csv extension. This allows the user to store data in a tabular or spreadsheet format. In this article, we will learn to convert the data of a CSV string to 2D array objects in JavaScript, where the first row of the string defines the file headers. We will be first reading this row and then mapping the remaining values with them. We will be using the following function that will act as a prototype function from array and string since it will help map the data ... Read More

JavaScript: Computing the average of an array after mapping each element to a value

Disha Verma
Updated on 25-Feb-2025 15:03:24

899 Views

Computing the average of an array after mapping each element to a value in JavaScript can be done by using the forEach() loop, the parseInt() method, the reduce() method, and the for..of loop. In this article, we are going to fetch all the values from an array and after mapping each element to a numerical value we will calculate its sum thus to compute its average. Given below is an array consisting of values. We will compute the average by summing up the values and then dividing it by the number of values available. Suppose Input is: [1, 2, ... Read More

How to compile a Typescript file?

Mayank Agarwal
Updated on 22-Apr-2022 13:44:46

1K+ Views

In this article are going to explore TypeScript and how to execute the same. TypeScript is an open-source programming language developed and maintained by Microsoft.Typescript is a bit syntactically different from the native JavaScript but also adds additional features to it. Typescript is the superset of JavaScript with a strong pace of development and object-oriented programming. It also does not run directly on the web browsers as JavaScript runsTypescript files need to be combined with JavaScript first and then they work as normal JavaScript. In order to compile and execute the typescript file, we need to install the node and ... Read More

JavaScript: How to check whether an array includes a particular value or not?

Mayank Agarwal
Updated on 22-Apr-2022 13:31:28

290 Views

In this article, we will be discussing the construction of an array. Once the array is created we will be looking out for a value by checking whether it exists in the array or not.But before checking for any particular value, let’s see how the arrays are created in JavaScript.Syntaxlet array = [arrayItem1, arrayItem2, arrayItem3 ...]Once the array is created, let’s see how to search for a specific value from the array. There are multiple approaches to searching for whether an element exists in the array or not. Below we are going to discuss the same.Approach #1This is a traditional ... Read More

JavaScript: How to check if a number is NaN or finite?

Disha Verma
Updated on 07-Mar-2025 13:01:54

579 Views

Checking whether a number is NaN (Not a Number) or finite is important while working with numerical computations in JavaScript. NaN (Not a Number) indicates a value that can't be represented as a number, often occurring from invalid operations like dividing zero by zero (0/0). Finite numbers are all real numbers in JavaScript that are neither Infinity, -Infinity, nor NaN. JavaScript provides several built-in methods to determine if a value is NaN (Not a Number) or if a number is finite. In this article, you will understand how to check if a number is NaN or finite using these built-in ... Read More

JavaScript: How to check if a number is even without using the modulo operator?

Shriansh Kumar
Updated on 30-Sep-2024 16:04:55

1K+ Views

For a given integer number, write a program in JavaScript to check whether a number is odd or even and return the same to the user. It’s pretty easy to check whether a number is even by using the modulo operator. But, in this article, we will be checking whether a number is even or not without using the modulo operator. Using the for loop In this approach, we are going to use the for loop to check whether a number is even or not. The idea is to take a Boolean flag variable as true and check it up ... Read More

How to chain asynchronous functions in JavaScript?

Mayank Agarwal
Updated on 22-Apr-2022 12:54:13

2K+ Views

JavaScriptis a single-threaded synchronous function that performs operations. It is a timeconsuming operation that blocks other operations of the thread.We can use the asynchronous programming provided by JavaScript that performs functions without blocking other operations of the thread. This can be done by asynchronous code like promises or async functions (which basically are cleaner promises).Asynchronous functions are cool but the time of their execution is not certain which might create a problem. Also, it is not easier to track async functions for any potential errors.In this article, we will be exploring the chaining of asynchronous functions using ES2015+ features like ... Read More

Advertisements