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
607 Views
We are required to write a JavaScript function that takes in a string as the first argument and a number as the second argument and a single character as the third argument, let’s call this argument char.The number is guaranteed to be smaller than the length of the array. The ... Read More
AmitDiwan
134 Views
We are required to write a JavaScript function that takes in a string as the only argument. The string is likely to contain question marks (?) in the beginning and the end. The function should trim off all these question marks from the beginning and the end keeping everything else ... Read More
AmitDiwan
1K+ Views
Suppose we have an array of arrays that contains the performance of a cricket player like this −const arr = [ ['Name', 'V Kohli'], ['Matches', 13], ['Runs', 590], ['Highest', 183], ['NO', 3], ['SR', 131.5] ];We are required to write a JavaScript function that takes ... Read More
AmitDiwan
823 Views
Suppose we have an object that contains information about the weather of a city −const obj = { city: "New Delhi", maxTemp: 32, minTemp: 21, humidity: 78, aqi: 456, day: 'Tuesday', };We are required to write a JavaScript function that takes in one such ... Read More
AmitDiwan
105 Views
We are required to write a JavaScript function that takes in two strings. Let’s call them str1 and str2.Our function should check either str1 starts with str2 or it ends with str2. If this is the case, we should return true otherwise we should return false.ExampleFollowing is the code −const ... Read More
AmitDiwan
948 Views
We are required to write a JavaScript function that takes in an array of Numbers as the only argument. The function should calculate and return the sum of alternative elements of the array.For example −If the input array is −const arr = [1, 2, 3, 4, 5, 6, 7];Then the ... Read More
AmitDiwan
141 Views
The delete operator in JavaScript is actually an object operator (used with objects).But since arrays are also indexed objects in JavaScript, we can use the delete operator with arrays as well.Consider the following array of literals −const arr = ['a', 'b', 'c', 'd', 'e'];ExampleLet us now execute the following program ... Read More
AmitDiwan
468 Views
We are required to write a JavaScript function that takes in a number as the first and the only argument. The function should use recursion to construct a string representing the binary notation of that number.For example −f(4) = '100' f(1000) = '1111101000' f(8) = '1000'ExampleFollowing is the code −const ... Read More
AmitDiwan
444 Views
We are required to write a JavaScript function that takes in a string as the only argument.The function should reverse the order of the words in the string and return the new string.The only condition is that we cannot use the inbuilt array method reverse().For example −If the input string ... Read More
AmitDiwan
326 Views
We are required to write a JavaScript function that takes in two arrays of numbers, let’s say arr1 and arr2. The function should find the intersection between the elements of the array. i.e., the elements that appear in both the arrays.The only condition is that if we encountered one element ... Read More