Javascript Articles

Page 160 of 534

Accessing and returning nested array value - JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 21-Apr-2023 2K+ Views

Each value in an array is referred to as an element, and each element has a certain numerical location in the array, which is referred to as its index. Nested Arrays, a feature of JavaScript, allow us to create arrays inside arrays. One or more arrays can be used as the elements of nested arrays. Although the term may be a little unclear, as we look further, it is actually rather fascinating. Accessing and returning nested array In JavaScript, a nested array is described as an Array (Outer array) inside another array (inner array). One or more inner Arrays are ...

Read More

How to iterate json array - JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 21-Apr-2023 7K+ Views

In JavaScript, arrays are used to hold several values in a single variable. Compare that to a variable that only has room for one value. Each item in an array has a number associated with it that you may access by using, referred to as a numeric index. The task we will perform in this article is “How to iterate a JSON array in JavaScript”. Let's get started with the article to get a better understanding of iterating a JSON array. Iterating JSON array Ordered lists of values are represented by JSON arrays. Multiple values can be stored in a ...

Read More

Apply an IF condition to every element in an HTML table with JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 21-Apr-2023 5K+ Views

The HTML tables are created using the tag in which the tag is used to create table rows and tag is used to create data cells. The elements under are regular and left aligned by default. The HTML tables allow web authors to arrange data like text, images, links, other tables, etc. into rows and columns of cells. Let’s dive into the article to learn more about applying an if condition to every element in an HTML table. Applying if condition to every element in an HTML table If a certain condition is true, the if/else ...

Read More

Create a to-do list with JavaScript

Yaswanth Varma
Yaswanth Varma
Updated on 21-Apr-2023 2K+ Views

The TODO list is a list that typically used to keep track of all the things we need to do in a given day, with the most crucial chores at the top and the least important items at the bottom. We can use it to plan our everyday schedules. We have the flexibility to add new assignments to the list, as well as remove those tasks that have been completed. A TODO list can be used to complete the following four main tasks Add new task Delete task Mark task as completed Edit task Let’s look into the ...

Read More

How to Use Conditional Statements On Objects?

Yaswanth Varma
Yaswanth Varma
Updated on 21-Apr-2023 910 Views

Conditional statements are used to control how an execution will proceed in response to various circumstances. You can take one action if a condition is true and another action if the condition is false. Conditional statements are the component of a computer program's logic, decision-making, or flow control. The task we are going to perform in this article was using conditional statements on objects. Let’s dive into the article for getting better understanding on conditional statements. Using if statement The if statement is the most basic type of conditional expression. If a statement is evaluated to see whether it is ...

Read More

How To Show Only One V-Menu At A Time When Clicking To Show The Menu?

Yaswanth Varma
Yaswanth Varma
Updated on 21-Apr-2023 1K+ Views

The task we are going to perform in this article was how to show only one v-menu at a time when clicking to show the menu, let’s dive into the article for getting better understanding on v-menu. A customized version of NativeUI was used to create the server-side trainer and menu known as vMenu. It features complete permissions support, allowing the server owner to control who can do what. Displaying v-menu A user interface's menu is a flexible element. It displays a popover with a variety of uses, like presenting a menu of choices. They may be used in conjunction ...

Read More

JavaScript Program for Check if an array is sorted and rotated

Prabhdeep Singh
Prabhdeep Singh
Updated on 21-Apr-2023 349 Views

A sorted array is an array where all the elements are present in increasing order. We have given an array of size N and an array containing the distinct integers (which means every integer is present only one time). We have to check the array is sorted and rotated in a clockwise direction. Here we have to return ‘YES’ if the array is sorted and rotated otherwise, we have to return ‘NO’. Note − Here we are talking about the sorted and rotated means at least one rotation should be present. We cannot consider a sorted array as a sorted ...

Read More

JavaScript Program for Ceiling in a sorted array

Prabhdeep Singh
Prabhdeep Singh
Updated on 21-Apr-2023 269 Views

An array is a linear data structure that contains the objects and in sorted array elements are present in increasing order. We have given a sorted array and an integer x. We have to print the ceiling of the integer x from the given array. The ceiling of a sorted array with value x is the smallest element larger than or equal to x, while the floor is the largest member less than or equal to x. If the ceiling of the x does not exist in the array we have to print ‘ceiling of x does not exist in ...

Read More

JavaScript Program to Check If a Singly Linked List is Palindrome

Prabhdeep Singh
Prabhdeep Singh
Updated on 20-Apr-2023 355 Views

A singly linked list is a linear data structure that is stored in a non-contiguous way in the memory and each block is connected by holding the address of the next block also known as a node. A palindrome can be explained as a set of characters, digits, etc, and it reads the same from both the front and backside. We will be given a singly linked list and have to find whether the values stored at the nodes are equal from both the front and backside. Input 1 -> 2 -> 3 -> 3 -> 2 -> 1 ...

Read More

How To Modify This JavaScript Code To Grab An Image URL From A JSON File, And Display It In HTML?

Yaswanth Varma
Yaswanth Varma
Updated on 20-Apr-2023 10K+ Views

This can be done by using the JavaScript method JSON.parse() to parse through the JSON file and extract the URL of the desired image. Then, an HTML img tag can be created with a source attribute set to this URL. Finally, this img tag can be appended to an existing HTML element in order to display it on your page. This will require some knowledge of basic JavaScript syntax, as well as familiarity with how JSON is structured and parsed within it. With these skills in hand, you should have no trouble modifying your code to achieve your goal! Let’s ...

Read More
Showing 1591–1600 of 5,338 articles
« Prev 1 158 159 160 161 162 534 Next »
Advertisements