
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
AmitDiwan has Published 10744 Articles

AmitDiwan
3K+ Views
Suppose, we have the following array in JavaScript −const arr = [{ "code": "2", "name": "PENDING" }, { "code": "2.2", "name": "PENDING CHILDREN" }, { "code": "2.2.01.01", "name": "PENDING CHILDREN CHILDREN" }, { "code": "2.2.01.02", "name": "PENDING CHILDREN CHILDREN02" }, { ... Read More

AmitDiwan
824 Views
Suppose, we have an array of objects that contains data about some fruits and vegetables like this −const arr = [ {food: 'apple', type: 'fruit'}, {food: 'potato', type: 'vegetable'}, {food: 'banana', type: 'fruit'}, ];We are required to write a JavaScript function that takes in one such array.Our ... Read More

AmitDiwan
562 Views
We are required to write a JavaScript function that takes in an array of strings. Our function should iterate through the array and find and return the longest string from the array.Our function should do this without changing the content of the input array.ExampleThe code for this will be −const ... Read More

AmitDiwan
269 Views
We are required to write a JavaScript function that takes in an array of Numbers.The array might contain some repeating / duplicate entries within it. Our function should add all the duplicate entries and return the new array thus formed.ExampleThe code for this will be −const arr = [20, 20, ... Read More

AmitDiwan
310 Views
Suppose, we have an array of objects like this −const arr = [ { region: "Africa", fruit: "Orange", user: "Gary" }, { region: "Africa", fruit: "Apple", user: "Steve" }, { region: "Europe", fruit: "Orange", user: "John" }, { region: "Europe", fruit: "Apple", user: "bob" }, ... Read More

AmitDiwan
744 Views
Suppose, we have a JSON array with key/value pair objects like this −const arr = [{ "key": "name", "value": "john" }, { "key": "number", "value": "1234" }, { "key": "price", "value": [{ "item": [{ "item": [{ ... Read More

AmitDiwan
3K+ Views
We have a complex json file that we have to handle with JavaScript to make it hierarchical, in order to later build a tree.Every entry of the JSON array has −id − a unique id, parentId − the id of the parent node (which is 0 if the node is ... Read More

AmitDiwan
792 Views
Suppose, we have the following array of arrays −const arr = [ [ ['dog', 'Harry'], ['age', 2] ], [ ['dog', 'Roger'], ['age', 5] ] ];We are required to write a JavaScript function that takes in one such nested array. The ... Read More

AmitDiwan
431 Views
We are required to write a JavaScript function that takes in an array of literal values. The function should then count the frequency of each element of the input array and prepare a new array on that basis.For example − If the input array is −const arr = [5, 5, ... Read More

AmitDiwan
906 Views
Suppose, we have a reference to an object −let test = {};This object will potentially (but not immediately) have nested objects, something like −test = {level1: {level2: {level3: "level3"}}};We are required to write a JavaScript function that takes in one such object as the first argument and then any number ... Read More