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
303 Views
Let’s say the following is our nested array −const arrayObject = [ [ { Name: "John" }, { countryName: "US" } ], [ { ... Read More
AmitDiwan
4K+ Views
To get the value of H1 to JavaScript variable, you can use −document.getElementById().innerHTML.Let’s say the following is our H1 heading − This is the demo program of JavaScript ........Now, let’s get the H1 value using the below code −Example Live Demo Document ... Read More
AmitDiwan
119 Views
Let’s say we have records with BOTID and Name of assigned users −let objectArray = [ { BOTID: "56", Name: "John" }, { BOTID: "57", Name: "David" }, { BOTID: "58", Name: "Sam"}, { BOTID: "59", Name: "Mike" }, { BOTID: "60", Name: "Bob" } ... Read More
AmitDiwan
374 Views
To add a newline in Unordered List, use the document.querySelector().append(). Following is the code −Example Live Demo Document h1{ font-size: 2.50rem; } h2, label{ font-size: 1.50rem; } Adding Name Demo ... Read More
AmitDiwan
297 Views
At first, set the keys −const name = ['Name1', 'Name2'];Now, map keys to the same value using for loop as in the below code −Exampleconst name = ['Name1', 'Name2']; const keyValueObject = {}; for (const k of name){ keyValueObject[k] = 'John'; } console.log(keyValueObject);To run the above program, you need ... Read More
AmitDiwan
772 Views
To remove and add new HTML tags, use the concept of hide() and show().Let’s say the following are our buttons −Click Me To hide above content Click Me To show above content To remove and add tags on button clicks, use hie() and show() −$(document).ready(function(){ $("#hide").click(function(){ ... Read More
AmitDiwan
1K+ Views
Let’s say the following are our values −let subjectNames = ['JavaScript', 'Angular', 'AngularJS', 'Java'];To count the non-empty and non-null values, use the forEach(). The syntax is as follows −yourArrayName.forEach(anyVariableName =>{ yourStatement1 . . . N } } )Now, use the if statement and check ... Read More
AmitDiwan
629 Views
Let’s say, we have the following objects in JavaScript −ObjectValue =[ { "id": "101", "details": { Name:"John", subjectName:"JavaScript" }}, { "id": "102", "details": { Name:"David", subjectName:"MongoDB" }}, { "id": "103" } ]To remove an object using filter(), the code is as follows −ExampleObjectValue =[ { "id": ... Read More
AmitDiwan
1K+ Views
For empty iframe src, use the element and set it like the following for an empty src −Example Live Demo Document To run the above program, save the file name “anyName.html(index.html)” and right click on the file. ... Read More
AmitDiwan
812 Views
To transform object of objects to object of array of objects, use the concept of Object.fromEntries() along with map().Exampleconst studentDetails = { 'details1': {Name: "John", CountryName: "US"}, 'details2': {Name: "David", CountryName: "AUS"}, 'details3': {Name: "Bob", CountryName: "UK"}, }; console.log( Object.fromEntries(Object.entries(studentDetails).map(([key, value]) => [key, [value]])) );To ... Read More