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 10740 Articles
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
401 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
477 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
113 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
260 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
341 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
159 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
146 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
AmitDiwan
163 Views
We are required to write a JavaScript function that takes in an array that contains some numbers, some strings and some false values. Our function should return the biggest Number from the array.For example: If the input array is −const arr = [23, 'hello', undefined, null, 21, 65, NaN, 1, ... Read More