The get() function of Map object accepts a key in string format and returns its respective value.
Syntax
Its Syntax is as follows
mapVar.get()
Example
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> 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')); </script> </body> </html>
Output
HBase