
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
216 Views
Suppose, we have an array of objects like this −const array = [ {key: 'a', value: false}, {key: 'a', value: 100}, {key: 'a', value: null}, {key: 'a', value: 23} ];We are required to write a JavaScript function that takes in one such array and places all ... Read More

AmitDiwan
512 Views
We are required to write a JavaScript function that takes in a string which contains English alphabet, for example −const str = 'This is a sample string, will be used to collect some data';The function should return an object containing the count of vowels and consonants in the string i.e. ... Read More

AmitDiwan
785 Views
We are required to write a JavaScript function that takes in an array of numbers as the first argument and a single number as the second argument. The function should return an array of all the elements from the input array that are greater than or equal to the number ... Read More

AmitDiwan
6K+ Views
Suppose, we have two arrays −const keys = [0, 4, 2, 3, 1]; const values = ["first", "second", "third", "fourth", "fifth"];We are required to write a JavaScript function that takes in the keys and the values array and maps the values to the corresponding keys. The output should be −const ... Read More

AmitDiwan
217 Views
Suppose, we have an array of objects like this −const arr = [{name: "Jack", age: "14"}, {name: "bob", age: "14"}, {name: "sue", age: "21"}, {name: "Jill", age: "16"}, {name: "Jack", age: "21"}];We are required to write a JavaScript function that takes in one such array and removes all the objects ... Read More

AmitDiwan
6K+ Views
Suppose we have an array like this −const arr = [ {"name": "Rahul", "score": 89}, {"name": "Vivek", "score": 88}, {"name": "Rakesh", "score": 75}, {"name": "Sourav", "score": 82}, {"name": "Gautam", "score": 91}, {"name": "Sunil", "score": 79}, ];We are required to write a JavaScript function that takes ... Read More

AmitDiwan
2K+ Views
Suppose, we have an array of literals that contains no duplicate elements like this −const arr = [2, 5, 4, 45, 32, 46, 78, 87, 98, 56, 23, 12];We are required to write a JavaScript function that takes in an array of unique literals and a number n.The function should ... Read More

AmitDiwan
386 Views
We are required to write a JavaScript function, let’s say randomColor that returns a randomly generated hex color every time it is called.ExampleFollowing is the code −const randomColor = () => { let color = '#'; for (let i = 0; i < 6; i++){ ... Read More

AmitDiwan
737 Views
Suppose, we have an object that contains rating of a property over some criteria like this −const rating = { "overall": 92, "atmosphere": 93, "cleanliness": 94, "facilities": 89, "staff": 94, "security": 92, "location": 88, "valueForMoney": 92 }We are required to write a ... Read More

AmitDiwan
598 Views
Suppose we have an array of numbers like this −const arr = [1, 2, 3, 4, 1, 7, 8, 9, 1];Suppose we want to find the index of the smallest element in the array i.e. 1 above.For this, we can simply use −const min = Math.min.apply(Math, arr); const ind = ... Read More