
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
246 Views
We are required to write a JavaScript function that takes in a number and returns a new number in which all the digits of the original number are squared and concatenated.For example: If the number is −99Then the output should be −8181because 9^2 is 81 and 1^2 is 1.Therefore, let’s ... Read More

AmitDiwan
348 Views
We are required to write a JavaScript function that recursively sums up the digits of a number until it reduces to a single digit number.We are required to do so without converting the number to String or any other data type.Therefore, let’s write the code for this function −ExampleThe code ... Read More

AmitDiwan
522 Views
We are required to write a JavaScript function that takes in any arbitrary number of arrays and returns an array of elements that are common to all arrays. If there are no common elements, then we should return an empty array.Therefore, let’s write the code for this function −ExampleThe code ... Read More

AmitDiwan
111 Views
We are required to write a JavaScript function that takes in a number, finds the sum of its digits and returns a prime number that is just greater than or equal to the sum.Therefore, let’s write the code for this function −ExampleThe code for this will be −const num = ... Read More

AmitDiwan
295 Views
We are required to write a JavaScript function that takes in an array of strings and returns the index of string that is shortest in length.We will simply use a for loop and persist the index of string which is shortest in length.Therefore, let’s write the code for this function ... Read More

AmitDiwan
99 Views
We are required to write a JavaScript function that takes in an array of Numbers and sums all the identical numbers together at one index.For exampleIf the input array is −const arr = [20, 10, 15, 20, 15, 10];Then the output should be −const output = [40, 20, 30];Therefore, let’s ... Read More

AmitDiwan
146 Views
We are required to write a JavaScript function that takes in two arrays and merges the arrays taking elements alternatively from the arrays.For exampleIf the two arrays are −const arr1 = [4, 3, 2, 5, 6, 8, 9]; const arr2 = [2, 1, 6, 8, 9, 4, 3];Then the output ... Read More

AmitDiwan
128 Views
Suppose we have an array that contains duplicate elements like this −const arr = [1, 1, 2, 2, 3, 4, 4, 5];We are required to write a JavaScript function that takes in one such array and returns a new array. The array should only contain the elements that only appear ... Read More

AmitDiwan
158 Views
We are required to write a JavaScript function that takes in an array of numbers.The function should return the sum of all the prime numbers present in the array.Therefore, let’s write the code for this function −ExampleThe code for this will be −const arr = [43, 6, 6, 5, 54, ... Read More

AmitDiwan
337 Views
We are required to write a JavaScript function that takes in a string that may contain some backward slashes.And the function should return a new string where all the backslashes with forward slashes.Therefore, let’s write the code for this function −ExampleThe code for this will be −const str = 'Th/s ... Read More