JavaScript Map set() methodThe JavaScript map set() method is used to add or updates an element to map object with the particular key-value pair. Each value must have a unique key. SyntaxThe set() method is represented by the following syntax: Parameterkey - It represents the key to be added. value - It represents the value to be added. ReturnThe Map object. JavaScript Map set() method exampleHere, we will understand set() method through various examples. Example 1Let's see an example to add key and value pair of elements to map object. Test it NowOutput: jQuery AngularJS Bootstrap Example 2In this example, we will determine the result when same key is added with different values. Test it NowOutput: AngularJS undefined Bootstrap
Next TopicJavaScript Map
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week