Javascript Articles

Page 37 of 534

Which is better, a website developed using HTML/CSS/JS or the one developed using WordPress?

Ayush Singh
Ayush Singh
Updated on 22-Aug-2023 881 Views

Since a website created with HTML, CSS, and JS is created entirely from code, it gives greater flexibility and customization choices. Design and functionality are entirely at the developers' hands, which makes it perfect for challenging or distinctive projects. However, WordPress streamlines the procedure with pre-made plugins and templates, making it appropriate for quick installs and non-technical users. However, for highly customised requirements, it could be restrictive. The decision ultimately comes down to the exact requirements, the developers' level of experience, and the degree of control desired over the look and feel of the website. Whats is HTML/CSS/JS? The fundamental ...

Read More

Sorting an array objects by property having null value in JavaScript

Sakshi Jain
Sakshi Jain
Updated on 21-Aug-2023 3K+ Views

The problem statement says to perform sorting of an array of objects taking in one specific condition to sort null value key pairs present in the array of objects to be pushed at the end of the array where the array of objects is given by the user as an input source. What is an Array in JavaScript ? If you are familiar with any other programming language like C, C++, or Java, you must have heard the term 'array.' In programming, an array is a collection of similar data elements under one roof. Now, an important question ...

Read More

Delete elements in first string which are not in second string in JavaScript

Sakshi Jain
Sakshi Jain
Updated on 21-Aug-2023 199 Views

The problem statement asks the user that given two string arrays as an input by the user , we need to delete the elements present in the first string taking in condition which are not present in the second string in javascript. The same problem statement can also be viewed as given two arrays of strings , the solution of the problem statement should return back the newer version of original first string array such that the first string array should only contain the elements that are present in second string array , remembering to preserve the order of ...

Read More

Validating a power JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 231 Views

In this problem we have to validate that a given number is a power of n. If the given number is power of n then it should return the true value of it otherwise it should return false. To check this kind of validation we generally use arithmetic operators like Modulus - %, Division - /, comparison operators like less than < or greater than >. Lets understand this problem with an example. True value: N = 27 So 33 = 27 False Value: N = 28 So 33 != ...

Read More

Split array entries to form object in JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 550 Views

The problem statement is saying that we have to find a solution for a given array and split it to form an object with a key-value pair in javascript. Understand the problem In simple terms we have to convert a given array into an object. There are several methods present in javascript to convert an array into an object. We will use and code each of them one by one. Using reduce() and split() methods In this method we will use reduce and split functions of javascript. Algorithm The algorithm here discusses ...

Read More

Sort Array of objects by two properties in JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 3K+ Views

Given problem says to sort the given array of objects by two properties and create a program in javascript. Understanding the problem Let's have a deep understanding of the problem statement. You will be given an array of objects with key and value. As per the problem statement we need a sorted form of that array. To implement this problem we will first sort the first column of array and then second column of array. And then again arrange it in sorted form. As we understand arrays are basic data structures in computer science. Array can also ...

Read More

Merging sorted arrays together JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 947 Views

Merging the sorted arrays together in javascript can be done using the sorting techniques available in data structures. In this problem we will be given two sorted arrays and we have to merge them. After merging them, return a single array which is also in a sorted form. For solving this problem we will use greedy approach. What are Sorted Arrays ? In javascript arrays are the collection of similar data types and we can resize the array in run time. Sorted arrays are sequential forms of items of an array. Their order should be ...

Read More

Merge and group object properties in JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 752 Views

In the given problem, we have to merge and group object properties with the help of javascript. In this article you will learn how to merge and group the same type of properties in javascript. Understanding the Problem We are required to create a javascript method that will take in one array of objects. The created function should group all the properties of all the objects that have a value for name property. For example: Input [ {name: 'Adi', age: 22, color:'Black'}, {name: 'Adi', weight: 40, height:6} , {name: 'Mack', ...

Read More

How to sort an array of objects based on the length of a nested array in JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 3K+ Views

This problem statement is saying to sort an array of objects based on the length of the nested arrays in it. For example if the first nested array has 3 elements and the second array has 2 elements then put the second array in first place and the first array at the second index. Understanding the problem Sorting an array of objects based on the size of a nested array is the task we have given. For example, let's say we have an array of objects in which each object has a name property and a hobbies property, ...

Read More

How to get single array from multiple arrays in JavaScript

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 18-Aug-2023 3K+ Views

In this problem we will understand how to get a single array from multiple arrays and different ways to solve this problem. We will use three methods to solve this problem: the first method is with the help of the spread operator, second concat method and finally last method using push with the spread operator. Understanding the problem We have given two or more arrays and we have to concatenate them in a single array. There can be many arrays given and after concatenating them it should appear as a single array. Let’s understand with ...

Read More
Showing 361–370 of 5,338 articles
« Prev 1 35 36 37 38 39 534 Next »
Advertisements