- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2418 Articles for HTML
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
236 Views
The has() function of Map object accepts a key in string format and returns a boolean value, if specified key exists it returns true else returns false.SyntaxIts Syntax is as followsmapVar.has()Example Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); mapVar.set('2', 'JavaFX'); mapVar.set('3', 'HBase'); mapVar.set('4', 'Neo4j'); document.write(mapVar.has('3')); OutputtrueExample Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
41 Views
The get() function of Map object accepts a key in string format and returns its respective value.SyntaxIts Syntax is as followsmapVar.get()Example Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); mapVar.set('2', 'JavaFX'); mapVar.set('3', 'HBase'); mapVar.set('4', 'Neo4j'); document.write(mapVar.get('3')); OutputHBase
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
62 Views
The forEach() function of Map object returns an iterator of the corresponding Map object and using this you can retrieve the key Value pairs of the map.SyntaxIts Syntax is as followsmapVar.forEach()Example Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); mapVar.set('2', 'JavaFX'); mapVar.set('3', 'HBase'); mapVar.set('4', 'Neo4j'); function show(values) { document.write(values); document.write(""); } mapVar.forEach(show); OutputJava JavaFX HBase Neo4j
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
86 Views
The clear() function of Map object removes all elements from the current Map object.SyntaxIts Syntax is as followsmapVar.clear()Example Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); mapVar.set('2', 'JavaFX'); mapVar.set('3', 'HBase'); mapVar.set('4', 'Neo4j'); var map = mapVar.clear(); document.write("Size of the map object: "+mapVar.size); OutputSize of the map object: 0Example Live Demo JavaScript Example var mapVar = new Map(); ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
499 Views
The size property of Map object accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsmapVar.sizeExample Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); mapVar.set('2', 'JavaFX'); mapVar.set('3', 'HBase'); mapVar.set('4', 'Neo4j'); document.write("Size of the map object: "+mapVar.size); OutputSize of the map object: 4
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
42 Views
The set() function of Map object adds or updates elements (key-value pairs) to a Map object.SyntaxIts Syntax is as followsmapVar.set()Example Live Demo JavaScript Example var mapVar = new Map(); mapVar.set('1', 'Java'); mapVar.set('2', 'JavaFX'); mapVar.set('3', 'HBase'); mapVar.set('4', 'Neo4j'); document.write(mapVar.has('3')); Outputtrue
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
211 Views
The stringify() function of a JSON object accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsJson.stringify();Example Live Demo JavaScript Example var jsonSample = '{Tutorial: Java, Version:8}'; jsonObj = JSON.stringify(jsonSample); document.write(jsonObj); Output"{Tutorial: Java, Version:8}"
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
129 Views
The JSON.parse() function accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsJson.parse();Example Live Demo JavaScript Example var jsonSample = '{"Tutorial": "Java", "Version":8 }'; jsonObj = JSON.parse(jsonSample); document.write("Tutorial Name: " + jsonObj.Tutorial); document.write(""); document.write("Tutorial Version: " + jsonObj.Version); OutputTutorial Name: Java Tutorial Version: 8
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
134 Views
Adding an element to an array can be done using different functions for different positions.Adding an element at the end of the arrayThis can be accomplished using the push method. For example, let veggies = ["Onion", "Raddish"]; veggies.push("Cabbage"); console.log(veggies);This will give the output −["Onion", "Raddish", "Cabbage"]You can also use this to push multiple items at the same time as it supports a variable number ofarguments. For example, let veggies = ["Onion", "Raddish"]; veggies.push("Cabbage", "Carrot", "Broccoli"); console.log(veggies);This will give the output −["Onion", "Raddish", "Cabbage", "Carrot", "Broccoli"]Adding an element at the start of the arrayThis can be accomplished using the unshift method. ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
3K+ Views
To create a collapsible list group, use the panel-collapse property with list-group property.ExampleThe list-group property lists items using the list-group-item property −Live Demo Bootstrap Example Questions/ Answers Click below to learn about the technologies for which we provide Interview Questions. Info Java PHP C++ HTML5 jQuery