Found 11336 Articles for Web Development

How to sort an array on multiple columns using JavaScript?

Abhishek
Updated on 20-Nov-2023 17:01:57

183 Views

A array with multiple columns is an array that contains multiple elements at single index or position OR we can say that it is an array of arrays that contains multiple arrays at each index of it and we have to sort that array according to the elements of those contained arrays. In this article, we are going to learn about the method of sorting an array of arrays with the help of sort() method. We will use the comparator function to compare the elements of inner arrays with each other and sort them accordingly. Let us see how we ... Read More

How to sort an array of object by two fields in JavaScript?

Abhishek
Updated on 20-Nov-2023 16:57:50

96 Views

An array of objects is an array that contains all the elements in the form of JavaScript objects. Here, we are said to use an array of objects with two fields that means, have to use objects with two elements as elements of the array. In this article, we are going to learn about the method of sorting the array of objects by two fields in JavaScript. We can simply use the sort() method of JavaScript to sort the elements of an array and give it a cmp or the comparator function to define the order in which we want ... Read More

How to sort a set in JavaScript?

Abhishek
Updated on 20-Nov-2023 16:51:32

109 Views

A set is also a data structure that is almost similar to the map data structure. The only difference between them is that map stores the elements in the form of key-value pair, while set does not it only stores a single value in the same order as it was inserted. It can also store primitive data types as well as objects as map does. A set contains all the elements in the same order as they are inserted. But, we can sort a set in any order whether in increasing or decreasing order of elements using the sort() method ... Read More

How to sort a map in JavaScript?

Abhishek
Updated on 20-Nov-2023 16:44:53

121 Views

In JavaScript, Map is a type of data structure that stores the values in the form of key value pairs. It can store all types of data types, whether they are primitive or JavaScript objects. It stores the elements in the same order in which they are inserted, hence, when we iterate through its elements, it prints the elements in the same order as we have stored them. As we have discussed that the order of elements stored in a Map is same as we insert elements in that Map. But, we can also sort the elements of the map ... Read More

How to sort a list alphabetically using jQuery?

Abhishek
Updated on 21-Nov-2023 09:37:08

124 Views

jQuery is a JavaScript library that works on the principle of write less, do more. In jQuery, the syntaxes that are longer and take more time to write are reduced, and alternate methods are introduced to use them in short form. In this article, we are going to learn about the method of sorting a list in alphabetical order using jQuery. Let us discuss some common methods of jQuery which we will use in the code example to sort the list in alphabetical order. text() method − The text method is used to get and set the text of ... Read More

How to solve the issue that arise while using performance.now() method in JavaScript?

Abhishek
Updated on 20-Nov-2023 16:38:32

57 Views

The performance.now() method is used to calculate the performance of the code written by any programmer or the coder. The performance.now() method will return a numerical value that will be the time taken by the written code to execute. The value returned by this method may vary every time we execute the code even for the same code. In today’s time, everyone wants to write the fast loading and the efficient code for a problem that can work on every parameter and fastest of all other solutions. So, to measure the efficiency and to make sure that the written code ... Read More

How to set the size of specific flex-item using CSS?

Abhishek
Updated on 20-Nov-2023 16:25:43

58 Views

In CSS, we can create our own flexbox using some flex properties provided by the CSS. The CSS flexbox is used to create the responsive layout for the mobile and other small screen devices to arrange the layout by adjusting their sizes for those screen sizes. To create a flexbox for the web page to manage items and their sizes, we are allowed to use the display: flex; property and then we can use the flex properties which are associated with this property to arrange the items according to the striking device width. Let us now discuss and understand the ... Read More

How to set the order of flexible items using CSS?

Abhishek
Updated on 20-Nov-2023 15:29:51

38 Views

Generally, all the HTML elements renders on the web page in the same order in which they are defined in the HTML document. But we can change the order of any element using the order property of CSS. We can use the order property on the elements which are defined inside a flexbox or an element that contains the display: flex; property. Once we used the display flex on the parent element, we can use the order property to change the order of the child flexible items using the order property. NOTE − Please make a note that the order ... Read More

How to set the maximum value of progress bar using HTML?

Abhishek
Updated on 20-Nov-2023 15:25:57

42 Views

The progress bar on any website is used to represent the percentage of any work that is completed like the download progress of any song or movie from any website. You can use the progress bar to show the amount of song or movie that is downloaded and remaining. In HTML, we can use the element to show a progress bar on the website to represent the amount of completed and the remaining work. You can handle the value of the progress bar on your own by defining the attributes with the element itself. Let us now understand ... Read More

How to set the inset shadow using CSS?

Abhishek
Updated on 20-Nov-2023 15:14:31

54 Views

Generally, we use the box-shadow property to apply shadow around any box or container. The box shadow property in CSS by default applies the shadow outside around the boundaries of the container. But we can also use the box shadow property to set the shadow inside the container as well. Let us see how we can use the box shadow property to set the inner shadow to a container and make it look attractive. Syntax We can use the box shadow property with different number of values for different purposes as shown in the below syntax − box-shadow: x-offset ... Read More

Previous 1 ... 5 6 7 8 9 ... 1134 Next
Advertisements