
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
136 Views
We are required to write a JavaScript function that takes in a string and any number of characters specified as separators. Our function should return a splitted array of the string based on all the separators specified.For example −If the string is −const str = 'rttt.trt/trfd/trtr, tr';And the separators are ... Read More

AmitDiwan
360 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
309 Views
Let’s say the following is our string. Some text is surrounded by special character hash(#) −var values = "My Name is #yourName# and I got #marks# in JavaScript subject";We need to replace the special character with valid values. For this, use replace() along with shift().ExampleFollowing is the code −var values ... Read More

AmitDiwan
2K+ Views
To implement this, extract id from attr() and use replace() to replace the id attribute.ExampleFollowing is the code − Document $('[id*="-"]').each(function () { console.log('Previous Id attribute: ' + $(this).attr('id')); ... Read More

AmitDiwan
5K+ Views
For this, use document.getElementById(“”) along with addEventListener().ExampleFollowing is the code − Live Demo Document FirstName: LastName: ... Read More

AmitDiwan
165 Views
Following is how you can validate RadioBoxes with jQuery −ExampleFollowing is the code − Live Demo Document Gender: Male Female isStudent: ... Read More

AmitDiwan
2K+ Views
The HTML input value is a string. To convert the string to integer, use parseInt().ExampleFollowing is the code − Live Demo Document GetANumber function result() { var numberValue = document.getElementById("txtInput").value; ... Read More

AmitDiwan
201 Views
Let’s say the following is our object −var details = { "STUDENTNAME": "John", "STUDENTAGE": 21, "STUDENTCOUNTRYNAME": "US" }As you can see above, the keys are in capital case. We need to turn all these keys to lower case. Use toLowerCase() for this.ExampleFollowing is the code −var details ... Read More

AmitDiwan
4K+ Views
Let’s say the following is our table − StudentName StudentCountryName JohnDoe UK DavidMiller US To get id from tr tag ... Read More

AmitDiwan
574 Views
Yes, you can pass default parameters in nested objects.Following is the code −ExampleFollowing is the code −function callBackFunctionDemo({ cl: { callFunctionName = "callBackFunction", values = 100 } = {} } = {}) { console.log(callFunctionName); console.log(values); } //This will print the default value. // 100 callBackFunctionDemo(); //This will print ... Read More