
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
Let’s say, we are required to write a JavaScript function that takes in an array of Numbers and returns a new array with elements as sum of two consecutive elements from the original array.For example, if the input array is −const arr = [3, 6, 3, 87, 3, 23, 2, ... Read More

AmitDiwan
100 Views
We have an array of literals like this −const arr = [56768, 5465, 5467, 3, 878, 878, 34435, 78799];We are required to write a JavaScript function that takes in this array and a number n and if the corresponding element contains more than or equal to n characters, then the ... Read More

AmitDiwan
775 Views
We are required to write a JavaScript function that takes in an array of numbers like this −const arr = [3, 6, 34, 12, 6, 8, 8, 5, 6, 8];The function should return the difference between the sum of elements present at the odd index and the sum of elements ... Read More

AmitDiwan
571 Views
We are required to write a JavaScript function that accepts two string and a number n.The function matches the two strings i.e., it checks if the two strings contains the same characters.The function returns true if both the strings contain the same character irrespective of their order or if they ... Read More

AmitDiwan
215 Views
We are required to write a JavaScript function that takes in a string and a number n as two arguments (the number should be such that it exactly divides the length of string) and we have to return an array of n strings of equal length.For example −If the string ... Read More

AmitDiwan
491 Views
Let’s say, we have an array of Numbers that contains only 0, 1 and we are required to write a JavaScript function that takes in this array and brings all 1s to the start and 0s to the end.For example − If the input array is −const arr = [1, ... Read More

AmitDiwan
389 Views
Let’s say, we are required to write a JavaScript function that takes in a string and returns a new string with words rearranged according to their increasing length.ExampleFollowing is the code −const str = 'This is a sample string only'; const arrangeByLength = str => { const strArr = ... Read More

AmitDiwan
452 Views
ASCII CodeASCII is a 7-bit character code where every single bit represents a unique character.Every English alphabet has a unique decimal ascii code.We are required to write a JavaScript function that takes in a string and counts the sum of all the ascii codes of the string charactersExampleFollowing is the ... Read More

AmitDiwan
123 Views
Conventionally, we have functions like parseInt() and parseFloat() that takes in a string and converts the number string to Number. But these methods fail when we have numbers embedded at random index inside the string.For example: The following would only return 454, but what we want is 4545453 −parseInt('454ffdg54hg53')So, we ... Read More

AmitDiwan
453 Views
We are required to write a JavaScript function that takes in two arrays of numbers of the same length. The function should return an array with any arbitrary nth element of the array being the sum of nth term from start of first array and nth term from last of ... Read More