
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
173 Views
To fix this, you can use map() in JavaScript.The syntax is as follows −var anyVariableName= new Array(yourSize).fill().map(Object);ExampleFollowing is the code −var arrayOfObject = new Array(5).fill().map(Object); console.log(arrayOfObject);To run the above program, you need to use the following command −node fileName.js.Here, my file name is demo311.js.OutputThis will produce the following output −PS ... Read More

AmitDiwan
2K+ Views
Use some conditions to stop after some time.The below code will stop in half a minute.ExampleFollowing is the code − Document var now = new Date().getTime(); var interval = setInterval(function () { ... Read More

AmitDiwan
377 Views
To sort an array of integers, use sort() in JavaScript.ExampleFollowing is the code −var arrayOfIntegers = [67, 45, 98, 52]; arrayOfIntegers.sort(function (first, second) { return first - second; }); console.log(arrayOfIntegers);To run the above program, you need to use the following command −node fileName.js.Here, my file name is demo310.js.OutputThis will ... Read More

AmitDiwan
435 Views
Yes, we can use jQuery to get values of selected checkboxes using the concept of input. We have to also use the :checked selector.ExampleFollowing is the code − Document Cricket Listening Music ... Read More

AmitDiwan
1K+ Views
Extract the value and convert it from String to integer to get price value from span tag.ExampleFollowing is the code − Document Value= 10 ... Read More

AmitDiwan
92 Views
To remove listener from outer function, use removeEventListener().ExampleFollowing is the code − Document Press Me var demoId = document.getElementById('demo'); demoId.addEventListener('click', function fun() { outerFunction(this, fun); }, false); function outerFunction(self, funct) { ... Read More

AmitDiwan
239 Views
To merger properties of two objects, you can use the concept of {...object1, ...object2, ... N).ExampleFollowing is the code −var firstObject = { firstName: 'John', lastName: 'Smith' }; var secondObject = { countryName: 'US' }; var mergeObject = {...firstObject, ...secondObject}; console.log(mergeObject);To run the above program, you ... Read More

AmitDiwan
313 Views
You can use your own function to get all combinations.ExampleFollowing is the code −function combination(values) { function * combinationRepeat(size, v) { if (size) for (var chr of values) yield * combinationRepeat(size - 1, v + chr); ... Read More

AmitDiwan
135 Views
We are required to write a function that compares two arrays and creates a third array filling that array with all the elements of the second array and filling null for all those elements that are present in the first array but misses out in the second array.For example:If the ... Read More

AmitDiwan
91 Views
Given an array of integers, we are required to write a function that takes this array and finds the one element that appears an odd number of times.There will always be only one integer that appears an odd number of times. We will approach this problem by sorting the array. ... Read More