
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
491 Views
Suppose, we have a nested array like this −const arr = ['zero', ['one', 'two' , 'three', ['four', ['five', 'six', ['seven']]]]];We are required to write a JavaScript function that takes in a nested array. Our function should then return a string that contains all the array elements joined by a semicolon ... Read More

AmitDiwan
311 Views
Suppose, we have an array of objects like this −const arr = [ { id : "23", name : "Item 1", isActive : true}, { id : "25", name : "Item 2", isActive : false}, { id : "26", name : "Item 3", isActive : false}, ... Read More

AmitDiwan
342 Views
We are required to write a JavaScript function that takes in an array of literal values as the first argument and a string as the second argument.Our function should sort the array alphabetically but keeping the string provided as the second argument (if it exists in the array) as the ... Read More

AmitDiwan
823 Views
Suppose, we have two child and parent JSON arrays of objects like these −const child = [{ id: 1, name: 'somename', parent: { id: 2 }, }, { id: 2, name: 'some child name', parent: { id: ... Read More

AmitDiwan
807 Views
Suppose we have a sorted array of numbers like this where we can have consecutive numbers.const arr = [1, 2, 3, 5, 7, 8, 9, 11];We are required to write a JavaScript function that takes one such array.Our function should form a sequence for this array. The sequence should be ... Read More

AmitDiwan
875 Views
Suppose, we have an array of objects like this −const arr = [ {"Date":"2014", "Amount1":90, "Amount2":800}, {"Date":"2015", "Amount1":110, "Amount2":300}, {"Date":"2016", "Amount1":3000, "Amount2":500} ];We are required to write a JavaScript function that takes in one such array and maps this array to another array that contains arrays instead ... Read More

AmitDiwan
875 Views
Suppose, we have a comma-separated string like this −const str = "a, b, c, d , e";We are required to write a JavaScript function that takes in one such and sheds it off all the whitespaces it contains.Then our function should split the string to form an array of literals ... Read More

AmitDiwan
239 Views
We are required to write a JavaScript function that takes in an array of literal values. The array might contain some repeating values inside it.Our function should remove all the repeating values keeping the first instance of repeating value in the array.ExampleThe code for this will be −const arr = ... Read More

AmitDiwan
5K+ Views
Suppose we have two arrays of objects, the first of which contains some objects with user ids and user names.The array contains objects with user ids and user addresses.The array is −const arr1 = [ {"id":"123", "name":"name 1"}, {"id":"456", "name":"name 2"} ]; const arr2 = [ {"id":"123", ... Read More

AmitDiwan
559 Views
We are required to write a JavaScript function that takes in an array of literal values. Our function should pick all those values from the array that appears exactly twice in the array and return a new array of those elements.ExampleThe code for this will be −const arr = [0, ... Read More