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
227 Views
We have an array of Numbers that contains some positive and negative even and odd numbers. We are required to sort the array in ascending order but all the even numbers should appear before any of the odd number and all the odd numbers should appear after all the even ... Read More
AmitDiwan
482 Views
We have to write a function that takes in an object and a string literals array, and it returns the filtered object with the keys that appeared in the array of strings.For example − If the object is {“a”: [], “b”: [], “c”:[], “d”: []} and the array is [“a”, ... Read More
AmitDiwan
351 Views
We have to write a function that accepts a string and mirrors its alphabet. For example −If the input is ‘abcd’ The output should be ‘zyxw’The function simply takes every character and map to the that is (26 - N) alphabets away from it, where is the 1 based index ... Read More
AmitDiwan
351 Views
Let’s say, we have an array that contains the score of some players in different sports. The scores are represented like this −const scores = [ {sport: 'cricket', aman: 54, vishal: 65, jay: 43, hardik: 88, karan:23}, {sport: 'soccer', aman: 14, vishal: 75, jay: 41, hardik: 13, karan:73}, ... Read More
AmitDiwan
3K+ Views
We have an array of objects, which further have nested objects like this −const arr = [{ id: 0, children: [] }, { id: 1, children: [{ id: 2, children: [] }, { id: 3, children: [{ ... Read More
AmitDiwan
415 Views
A butterfly shuffled array in JavaScript is an array of Numbers that is sorted such that the numbers decrease as we approach the center of array and increase as we approach the end of array. The biggest number is placed at the very first index.Another variation of butterfly shuffled array ... Read More
AmitDiwan
371 Views
each_cons() - RubyThe each_cons() method of enumerable is an inbuilt method in Ruby that iterates for consecutive N elements starting from each element every time. If no block is given, it returns the enumerator.JS equivalent of each_cons()Suppose we have an array of Number literals (JS equivalent of Ruby’s enumerable in ... Read More
AmitDiwan
248 Views
We have the following data inside a json file data.json −data.json{ "names": [{ "name": "Ramesh", "readable": true }, { "name": "Suresh", "readable": false }, { "name": "Mahesh", "readable": true ... Read More
AmitDiwan
200 Views
The idea here is to take two strings as input and return true if a is substring of b or b is sub string of a, otherwise return false.For example −isSubstr(‘hello’, ‘hello world’) // true isSubstr(‘can I use’ , ‘I us’) //true isSubstr(‘can’, ‘no we are’) //falseTherefore, in the function ... Read More
AmitDiwan
281 Views
We are required to write a JavaScript function that takes in a binary number as a string and returns its numerical equivalent in base 10. Therefore, let’s write the code for the function.This one is quite simple, we iterate over the string using a for loop and for each passing ... Read More