
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
Let’s say the following are our array of objects:const details = [ { employeeFirstName: "John", employeeLastName: "Doe" }, { employeeFirstName: "David", employeeLastName: "Miller" ... Read More

AmitDiwan
102 Views
Let’s say the following is our array object −var arrayObject = [ "John", "David", "Mike" ]Use length property to set the length to 0 and clear memory.The syntax is as follows to clear memory and allocate again −yourArrayObjectName.length=0; // ... Read More

AmitDiwan
264 Views
To fetch alternative values, use the array index and check with the following condition −if(index%2==0) { // code } The above will display the even values.ExampleFollowing is the code −var subjectsName=["MySQL", "JavaScript", "MongoDB", "C", "C++", "Java"]; for(let index=0;index node demo222.js Subject name at even position=MySQL Subject name at even position=MongoDB Subject ... Read More

AmitDiwan
203 Views
Use get keyword to make getter function.ExampleFollowing is the code −const studentDetails = { studentName: "David Miller", get studentName() { console.log('I am calling the getter method...') } } console.log(studentDetails.studentName);To run the above program, you need to use the following command −The output is as ... Read More

AmitDiwan
269 Views
For this, use the “this” keyword.ExampleFollowing is the code −class Employee { constructor() { this.tempObject = [ { firstName: "David", setTheAnotherFirstName() { ... Read More

AmitDiwan
1K+ Views
To add property, use map(). Let’s say the following is our array −const firstname = ['John', 'David', 'Bob'];Following are our array of objects −const studentDetails = [ { firstname: 'Carol', marks: 78 }, { firstname: 'Mike', ... Read More

AmitDiwan
1K+ Views
Let’s say we have the following variables −var value1 = 10; var value2 = 10.15;Use the Number() condition to check that a number is float or integer −Number(value) === value && value % 1 !== 0; }ExampleFollowing is the code −function checkNumberIfFloat(value) { return Number(value) === value && value ... Read More

AmitDiwan
333 Views
For ternary operator alternative, simply use if else in JavaScript. Let’s say, we have two numbers −var number1=12; var number2=12;To compare, we can use if else, instead of the ternary operator −if(number1==number2) console.log("true"); else console.log("false");ExampleFollowing is the code −var number1=12; var number2=12; var result=(number1==number2)?true:false; console.log(result); if(number1==number2) console.log("true"); else ... Read More
How do you remove all the options of a select box and then add one option and select it with jQuery?

AmitDiwan
736 Views
To remove, use remove() and append() to add option in already created select list. Let’s say the following is our select − JavaScript MySQL ExampleFollowing is the code to remove all the options and add a new one − Live Demo Document ... Read More

AmitDiwan
629 Views
Use tag for a new line.ExampleFollowing is the code − Document My Name is David Miller document.getElementById("headingDemo").innerHTML = "My Favourite Subject is JavaScript" + '' + "I ... Read More