
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6710 Articles for Javascript

1K+ Views
In this problem statement, our aim is to write the factorial function with reduce and range with the help of Javascript. So basically range and reduce are the predefined functions of Javascript. What is the use of reduce and range functions in Javascript ? In Javascript the reduce and range functions are the most useful function when working with arrays. The reduce function takes an array and reduces it to a single value by processing a function for every item of the array. The function takes two parameters, the first one is the accumulator which stores the result of ... Read More

3K+ Views
In this problem statement, our task is to to create a nested unordered list based on nesting of arrays with the help of Javascript. So for doing this task we will use a function to call recursively for each nested array and create a new unordered list.. Understanding the problem statement In the above problem statement we have to create a function for a nested list in HTML using Javascript. The input for the code will be an array that can have any number of items and can also include other arrays that represent nested lists. The code will be ... Read More

422 Views
In the given problem statement, we have to print an inverted count with a recursive loop and code with the help of Javascript. So basically we have to print the count in inverted count or we can say in descending order. What is Recursive technique ? The recursive technique is an approach that involves solving a problem by breaking it into smaller pieces of the same problem till a base case is reached. This function calls itself with different arguments in order to achieve the required output. This is commonly used when the solution to a problem depends on ... Read More

1K+ Views
In this problem statement, our aim is to sort strings with decimal points with the help of Javascript functionalities. So for doing this task we will use the sort and map method of Javascript. Understanding the problem statement The problem statement is to write a function in Javascript by which we can sort the given strings with decimal points. For example if we have an array of strings like [‘3.3’, ‘4.4’, ‘2.3’, ‘1.2’] so our task is to sort the given array of strings. But for sorting these strings first we need to convert it into numbers. After converting ... Read More

326 Views
Suppose, we have a sorted (increasing order) array of Numbers like this −const arr = [2, 5, 7, 8, 9];We are required to write a JavaScript function that takes in one such array. The function should construct a new subarray for each element of the input array.The sub-array should contain the difference (difference between that very element and the succeeding elements one by one) elements.Therefore, for the first array element, the differences are −5 - 2 = 3 7 - 2 = 5 8 - 2 = 6 9 - 2 = 7Therefore, the subarray for the first element should ... Read More

1K+ Views
In this problem statement, our task is to write a JavaScript program by which we can simply filter an associative array with the help of another array. Before discussing the solution for the given problem, let's familiarize ourselves with associative array first. What is an associative array? An associative array is a data structure which is used to store the key and value pairs. In this each key is associated with a value given to the key. The keys in this array are unique identifiers that can be used to retrieve their respective values. In an associative array the keys ... Read More

4K+ Views
In this problem statement, our task is to add a unique id for every object entry in a JSON object with the help of Javascript. So for doing this task we will use a loop and a variable to store the id for each object in the JSON object. Understanding the problem statement The problem statement is to write a function in Javascript by which we can add a unique id to every item in the given JSON object. For updating every JSON object by adding new id to every object we will use basic Javascript functionality. For example we ... Read More

973 Views
In our problem statement we have to sort odd and even elements separately with the help of Javascript functionalities. So for doing this task we will use for loops and bubble sort for sorting odd and even numbers separately. Understanding the problem statement The problem statement is to write a Javascript function that will help to sort odd and even numbers in a given array. For example if we have an array [2, 3, 5, 4] then we will first sort even indexed elements [3, 4] and then sort the odd indexed elements in the array [2, 5]. After sorting ... Read More

237 Views
In the given problem statement, we have to find the whole number between two integers with the help of Javascript functionalities. So for doing this task we can use some in-built functions of javascript and also for loop to get the required result. Understanding the problem statement The problem statement is to write a function in Javascript that will help to find out the whole random number between two integer numbers. For example if we want to print a random number between 1 to 5 so there are 5 possibilities, the number can be 1, 2, 3, 4, 5. So ... Read More

4K+ Views
In this problem statement, our task is to get the combinations of all items in an array with the help of Javascript functionalities. So for doing this task we can use a recursive approach that iteratively adds items to a running list of combinations. Understanding the problem statement The problem statement is to write a function in Javascript that will help to find out the combinations of all the elements in an array and create a separate array to show these combinations. For example, if we have an array [ 1, 2 ] so the combinations of this array will ... Read More