
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
500 Views
Suppose, we have a nested array of arrays like this −const arr = [ ["LEFT", "RIGHT", "RIGHT", "BOTTOM", "TOP"], ["RIGHT", "LEFT", "TOP"], ["TOP", "LEFT"] ];We are required to write a JavaScript function that takes in one such array. The function then should pick the smallest subarray (smallest ... Read More

AmitDiwan
263 Views
Suppose, we have an array of objects like this −const arr = [ { Phase: "Phase 1", Step: "Step 1", Task: "Task 1", Value: "5" }, { Phase: "Phase 1", Step: "Step 1", Task: "Task 2", Value: "10" }, { Phase: "Phase 1", Step: "Step 2", Task: ... Read More

AmitDiwan
348 Views
We have got an array of objects. If one property of the object is the same as in another object, we consider it to be a duplicate entry.We want to group objects by this property and store information about how many times the "duplicate" occurred. X A B O ... Read More

AmitDiwan
152 Views
We have a set of vertical regions defined by y1 and y2 coordinates, where y1 is the starting point and y2 is the ending point of each region.The origin of our coordinates system is the top-left corner, so y2 is always greater than y1.This is an example −const regions = ... Read More

AmitDiwan
2K+ Views
Suppose we have two arrays describing some cashflow like these −const months = ["jan", "feb", "mar", "apr"]; const cashflows = [ {'month':'jan', 'value':10}, {'month':'mar', 'value':20} ];We are required to write a JavaScript function that takes in two such arrays. Our function should then construct a combined array of ... Read More

AmitDiwan
115 Views
Suppose, we have two JavaScript objects defined like this −const a = { a: 1, af: function() { console.log(this.a) }, }; const b = { b: 2, bf: function() { console.log(this.b) }, };We are required to write a JavaScript function that takes in two such objects. ... Read More

AmitDiwan
279 Views
Let’s say, we have an array of numbers and we added elements to it. You need to devise a simple way to remove a specific element from an array.The following is what we are looking for −array.remove(number);We have to use core JavaScript. Frameworks are not allowed.ExampleThe code for this will ... Read More

AmitDiwan
305 Views
We are required to depict the ways in which we can access the current timestamp in JavaScript in −---seconds---millisecondsJavaScript works with the number of milliseconds since the epoch whereas most other languages work with the seconds.This will give you a Unix timestamp (in seconds) −const date = new Date(); const ... Read More

AmitDiwan
113 Views
We are required to write a JavaScript function that takes in an array of Numbers as the first argument and a number, say n, as the second argument.Our function should calculate and return the greatest possible product of n numbers from the array.ExampleThe code for this will be −const getHighestProduct ... Read More

AmitDiwan
1K+ Views
Suppose, we have an array of nested objects like this −const arr = [{ id: 1, legs:[{ carrierName:'Pegasus' }] }, { id: 2, legs:[{ carrierName: 'SunExpress' }, { carrierName: 'SunExpress' }] }, { ... Read More