
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
2K+ Views
We have to write a function, that does some simple task, say adding two numbers or something like that. We are required to demonstrate the way we can access the variables declared inside that function in some other function or globally.ExampleFollowing is the code −const num = 5; const addRandomToNumber ... Read More

AmitDiwan
525 Views
If we look closely at the problem statement, the difference between ([] == false) and ([] || true) is the following −In the first case, we are using loose conditional checking, allowing type coercion to take over.While in the second case, we are evaluating [] to its respective Boolean (truthy ... Read More

AmitDiwan
176 Views
We are required to sort a dynamic JavaScript array. The condition is that we are required to sort it according to the values stored in a particular order in a standard predefined array.Let’s say the following is our dynamic array −const dbArray = ['Apple', 'Banana', 'Mango', 'Apple', 'Mango', 'Mango', 'Apple'];And ... Read More

AmitDiwan
704 Views
We are required to write a JavaScript function that takes in a string as first argument and two single element strings. The function should return the distance between those single letter stings in the string taken as first argument.For example −If the three strings are −const str = 'Disaster management'; ... Read More

AmitDiwan
584 Views
We are required to write a JavaScript function that takes in two strings that may / may not contain some common elements. The function should return an empty string if no common element exists otherwise a string containing all common elements between two strings.Following are our two strings −const str1 ... Read More

AmitDiwan
137 Views
In JavaScript, we can write our own custom functions and assign them to the existing standard data types (it is quite similar to writing library methods but in this case the data types are primitive and not user defined. We are required to write a JavaScript String function by the ... Read More

AmitDiwan
449 Views
Given a string, we are required to write a function that creates an object that stores the indexes of each letter in an array. The letters (elements) of the string must be the keys of objectThe indexes should be stored in an array and those arrays are values.For example −If ... Read More

AmitDiwan
429 Views
The “full house in poker” is a situation when a player, out of their five cards, has at least three cards identical. We are required to write a JavaScript function that takes in an array of five elements representing a card each and returns true if there's a full ... Read More

AmitDiwan
444 Views
We are required to write a JavaScript function that takes in a string of strings joined by whitespaces. The function should calculate and return the average length of all the words present in the string rounded to two decimal placesExampleFollowing is the code −const str = 'This sentence will be ... Read More

AmitDiwan
288 Views
Lunar SumThe concept of lunar sum says that the sum of two numbers is calculated, instead of adding the corresponding digits, but taking the bigger of the corresponding digits.For example −Let’s say, a = 879 and b = 768(for the scope of this problem, consider only the number with equal ... Read More