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 10740 Articles
AmitDiwan
496 Views
Suppose we have an object like this −const obj = { key1: 56, key2: 67, key3: 23, key4: 11, key5: 88 };We are required to write a JavaScript function that takes in this object and returns a sorted array like this −const arr = [11, ... Read More
AmitDiwan
363 Views
Suppose, we have an array of objects like this −const arr = [ {id: 1, name: "Mohan"}, {id: 2, name: "Sohan"}, {id: 3, name: "Rohan"} ];We are required to write a function that takes one such array and constructs an object from it with the id property ... Read More
AmitDiwan
158 Views
Suppose, we have an array of objects like this −const arr = [ {'ID-01':1}, {'ID-02':3}, {'ID-01':3}, {'ID-02':5} ];We are required to add the values for all these objects together that have identical keysTherefore, for this array, the output should be −const output = [{'ID-01':4}, {'ID-02':8}];We will ... Read More
AmitDiwan
341 Views
Suppose we have an array like this −const arr = [ {unit: 35, brand: 'CENTURY'}, {unit: 35, brand: 'BADGER'}, {unit: 25, brand: 'CENTURY'}, {unit: 15, brand: 'CENTURY'}, {unit: 25, brand: 'XEGAR'} ];We are required to write a function that groups all the brand properties of ... Read More
AmitDiwan
992 Views
We are required to write a JavaScript function that takes in an array of String / Number literals and returns a subarray of all the elements that were palindrome in the original array.For example −If the input array is −const arr = ['carecar', 1344, 12321, 'did', 'cannot'];Then the output should ... Read More
AmitDiwan
239 Views
Suppose, we have an object like this −const products = { "Pineapple":38, "Apple":110, "Pear":109 };All the keys are unique in themselves and all the values are unique in themselves. We are required to write a function that accepts a value and returns its keyFor example: findKey(110) should ... Read More
AmitDiwan
640 Views
We are required to write a JavaScript function that takes in a string and any number of characters specified as separators. Our function should return a splitted array of the string based on all the separators specified.For example −If the string is −const str = 'rttt.trt/trfd/trtr, tr';And the separators are ... Read More
AmitDiwan
1K+ Views
We are required to write a function that, given a number, say, 123, will output an array −[100, 20, 3]Basically, the function is expected to return an array that contains the place value of all the digits present in the number taken as an argument by the function.We can solve ... Read More
AmitDiwan
375 Views
Suppose we have an array of arrays of numbers like this −const arr = [[1, 45], [1, 34], [1, 49], [2, 34], [4, 78], [2, 67], [4, 65]];Each subarray is bound to contain strictly two elements. We are required to write a function that constructs a new array where all ... Read More
AmitDiwan
761 Views
We are required to write a JavaScript function that creates a multi-dimensional array based on some inputs. It should take in three elements, namely −row − the number of subarrays to be present in the array, col − the number of elements in each subarrayval minus; the val of each ... Read More