Nikhilesh Aleti has Published 93 Articles

How do we embed custom data attributes on all HTML elements?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 08:02:07

447 Views

In this article, we need to embed custom data attributes on all HTML elements. we can do so, using the data-* attribute in HTML. The data-* attribute in HTML is used to custom data private to the webpage or application. This attribute adds custom values to an HTML element. The ... Read More

Execute a script when a user navigates to a page in HTML?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 07:59:00

148 Views

The task we need to perform in this article is executing a script when a user navigates to a page in HTML. We can do the above task (executing a script when a user navigates to a page in HTML) by using "onpageshow Event". Before we jump into the examples ... Read More

Set the size of the icons in HTML

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 07:54:50

5K+ Views

In this article, we are going to discuss how to set the size of the icons in HTML. An icon is a symbol that represents a specific action on a webpage. The Icon Fonts contain symbols and glyphs. There are several icon libraries(fonts) that provide icons and can be used ... Read More

Function to compute factorial of a number in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:24:16

10K+ Views

In this article, the given task is to get the factorial of a number in JavaScript. What is the factorial of a number? The multiplication of all positive integers smaller than or equal to n gives the factorial of a non-negative integer. For example, assume the non-negative integer is ... Read More

Converting array of objects to an object in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:22:03

368 Views

The given there is an array and the task is to convert an array of objects to an object. Input-Output Scenario Let’s look into an input-output scenario of converting the array objects into an object. Consider there is an array having objects in it. Now, we need to convert those ... Read More

Converting two arrays into a JSON object in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:20:13

4K+ Views

Given two arrays and the task is to convert those two arrays into a JSON object. Where the first array elements are keys of the object and the second array elements are values of the object. Input-Output Scenario Let’s look into the scenario of how two arrays will be converted ... Read More

Removing property from a JSON object in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:16:00

6K+ Views

A JSON (JavaScript object notation) Object is always surrounded by the curly braces {}. The values must be a valid JSON data type, and the keys must be strings. JSON supports the following data types: number, string, object, Boolean, array, and null. There has to be a colon ... Read More

Finding product of Number digits in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:13:42

1K+ Views

We are required to write a JavaScript program that takes in a number and finds the product of all of its digits. Input output scenarios Assume there is a number digit assigned to a variable and task is to find the product of the number. Input = 12345; Output ... Read More

Finding the mid of an array in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:11:29

2K+ Views

An Array in JavaScript is datatype which is used to store homogeneous elements. These elements are stored at contiguous memory locations. We can access each data element in the array with the help of index numbers. The index numbers will start from 0. Syntax Following is the syntax of creating ... Read More

Return the sum of two consecutive elements from the original array in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 23-Sep-2022 11:09:39

1K+ Views

An Array is known as collection of similar data elements which are stored at contiguous memory locations. Array is such a simple data structure where we can access each data element in the array with the help index numbers, which starts from 0. The following is the basic declaration ... Read More

Advertisements