
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
To make addEventListener() repeatedly work on button clicks, use the following code −Example Live Demo Document Click Me var eventValue = function (event) { document.body.appendChild(document.createElement('div')) .textContent = event.type; } var pressed ... Read More

AmitDiwan
163 Views
Let’s say the following is our array with elements preceded by a + sign −var studentNames = [ '+John Smith', '+David Miller', '+Carol Taylor', '+John Doe', '+Adam Smith' ];To remove the + sign, the code is as follows −ExamplestudentNames = [ '+John Smith', ... Read More

AmitDiwan
4K+ Views
Let’s say the following is our button −Sum We are calling the function addTheValue(10) with parameter 10 on button click. On clicking the button, we are adding the value 10 as in the below code −Example Live Demo Document ... Read More

AmitDiwan
1K+ Views
Let’s say the following is our dropdown (select) − John Mike Sam David Carol Following is the code to get the length of list options in JavaScript −Example Live Demo Document John Mike ... Read More

AmitDiwan
298 Views
Let’s say the following is our array −var details = [ {subjectId:110, subjectName: 'Java' }, {subjectId:111, subjectName: 'Javascript' }, {subjectId:112, subjectName: 'MySQL' }, {subjectId:113, subjectName: 'MongoDB' } ];Now, use the concept of map(). The code is as follows −Examplevar details = [ {subjectId:110, subjectName: 'Java' ... Read More

AmitDiwan
3K+ Views
The requirements here are simple, we are required to write a JavaScript function that takes in a number and returns the number of digits in it.For example −The number of digits in 4567 is 4 The number of digits in 423467 is 6 The number of digits in 457 is ... Read More

AmitDiwan
323 Views
We are required to write a JavaScript function that takes in an array of Numbers and returns a new array with elements as the sum of two consecutive elements from the original array.For example, if the input array is −const arrayOne = [0, 1, 2, 3, 4, 5, 6, 7, ... Read More

AmitDiwan
1K+ Views
We are required to write a JavaScript function that takes in two arrays of Numbers and checks whether all the elements of the first array exist in the second or not.Following are our arrays −const arr1 = [34, 78, 89]; const arr2 = [78, 67, 34, 99, 56, 89];Let's write ... Read More

AmitDiwan
154 Views
We have an array of objects like this −let data = [ {id:1, Name: "Abe", RowNumber: 1 }, {id:2, Name: "Bob", RowNumber: 2 }, {id:3, Name: "Clair", RowNumber: 3 }, {id:4, Name: "Don", RowNumber: 3.0 }, {id:5, Name: "Edna", RowNumber: 3.1 }, {id:6, Name: ... Read More

AmitDiwan
200 Views
We have two arrays like these −let arr1 = [{"LEVEL":4, "POSITION":"RGM"}, {"LEVEL":5, "POSITION":"GM"}, {"LEVEL":5, "POSITION":"GMH"}] let arr2 = [{"EMAIL":"test1@stc.com", "POSITION":"GM"}, {"EMAIL":"test2@stc.com", "POSITION":"GMH"}, {"EMAIL":"test3@stc.com", "POSITION":"RGM"}, {"EMAIL":"test3@CSR.COM.AU", "POSITION":"GM"} ]We are required to write a function that adds the property level to each object of arr2, picking it up from the object from ... Read More