TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

JavaScript Map

JavaScript Map with javascript map methods, abs() method, round() method, ceil() method, floor() method, pow() method, random() method, sqrt() method, max() method, min() method, log() method, sin() method, cos() method, tan() method etc.

<< Back to JAVASCRIPT

JavaScript Map Object

The JavaScript Map object is used to map keys to values. It stores each element as key-value pair. It operates the elements such as search, update and delete on the basis of specified key.

Syntax

new Map([iterable])

Parameter

iterable - It represents an array and other iterable object whose elements are in the form of key-value pair.

Points to remember

  • A map object cannot contain the duplicate keys.
  • A map object can contain the duplicate values.
  • The key and value can be of any type (allows both object and primitive values).
  • A map object iterates its elements in insertion order.

JavaScript Map Methods

Let's see the list of JavaScript map methods with their description.

Methods Description
clear() It removes all the elements from a Map object.
delete() It deletes the specified element from a Map object.
entries() It returns an object of Map iterator that contains the key-value pair for each element.
forEach() It executes the specified function once for each key/value pair.
get() It returns the value of specified key.
has() It indicates whether the map object contains the specified key element.
keys() It returns an object of Map iterator that contains the keys for each element.
set() It adds or updates the key-value pairs to Map object.
values() It returns an object of Map iterator that contains the values for each element.

Next TopicJavaScript WeakSet




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf