Nikhilesh Aleti has Published 97 Articles

Tree Traversals in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 05:56:44

2K+ Views

A tree is a non-linear hierarchical data structure and it is a combination of both nodes and edges. Nodes in the tree store the values and these nodes are connected to each other with Edges. The topmost node of the tree doesn’t have any Parent node and is called a ... Read More

Recursion example in JavaScript to display numbers is descending order?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 08:20:18

760 Views

In this article, the given task is to display the numbers in descending order by using recursion. Let’s get an understanding of the task by looking into the input-output scenarios. Input-Output scenario Let’s look into an input-output scenario, where there is an input number and we need to print the ... Read More

Checking the equality of array elements (sequence dependent) in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

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

233 Views

In this article, the given task is to check the equality of array elements (sequence dependent). Before we proceed into examples, let’s look at how the input-output scenario will look when we are checking the equality of array elements (sequence dependent) in JavaScript. Input-Output scenario Let’s look into the input-output ... Read More

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

Nikhilesh Aleti

Nikhilesh Aleti

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

433 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

138 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

How to specify the HTML content of the page to show in the <iframe> in HTML?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 07:49:57

3K+ Views

In this article, we need to display the HTML content of the page in an iframe; A browser window divided as a separate page. We can achieve this task using the tag and it’s srcdoc attribute. HTML tag The tag in HTML specifies an inline frame. This ... 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

351 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

Advertisements