
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
149 Views
We are required to write a JavaScript function that generates an array of exactly five unique random numbers. The condition is that all the numbers have to be in the range [0, 9] and the first number cannot be 0.ExampleFollowing is the code −const fiveRandoms = () => { ... Read More

AmitDiwan
322 Views
We are required to write a JavaScript function that takes in a string that represents a number. Replace the leading zero with spaces in the number. We need to make sure the prior spaces in number are retained.For example, If the string value is defined as −" 004590808"Then the ... Read More

AmitDiwan
611 Views
We are required to write a JavaScript function that takes in a number and calculates its square root without using the Math.sqrt() function.ExampleFollowing is the code −const square = (n, i, j) => { let mid = (i + j) / 2; let mul = mid * mid; ... Read More

AmitDiwan
217 Views
We are required to write a JavaScript function that takes in a string. It should print out each number for every corresponding letter in the string.For example, a = 1 b = 2 c = 3 d = 4 e = 5 . . . Y = 25 Z = ... Read More

AmitDiwan
2K+ Views
We are required to write a JavaScript function that takes in a number which may be an integer or a floating-point number. If it's a floating-point number, we have to return the count of numbers after the decimal point. Otherwise we should return 0.For our example, we are considering two ... Read More

AmitDiwan
449 Views
We are required to write a JavaScript function that takes in an array of numbers and returns a number which can exactly divide all the numbers in the array.Let’s say the following is our array −const arr = [4, 6, 34, 76, 78, 44, 34, 26, 88, 76, 42];ExampleFollowing is ... Read More

AmitDiwan
1K+ Views
We are required to write a JavaScript function that takes in an array of numbers. The function should sort the array with using the Array.prototype.sort() method. We are required to use the Array.prototype.reduce() method to sort the array.Let’s say the following is our array −const arr = [4, 56, 5, ... Read More

AmitDiwan
415 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 concatenatedFor example: If the number is −9119Then the output should be −811181because 9^2 is 81 and 1^2 is 1.ExampleFollowing is ... Read More

AmitDiwan
215 Views
We are required to write a JavaScript function takes in an array of numbers. The function should bring all the 3-digit integers to the front of the array.Let’s say the following is our array of numbers −const numList = [1, 324, 34, 3434, 304, 2929, 23, 444];ExampleFollowing is the code ... Read More

AmitDiwan
1K+ 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.Let’s say the following are our arrays −const arr1 = ... Read More