JavaScript Map has() methodThe JavaScript map has() method indicates whether the Map object contains the specified key. It returns true if the specified key is present, otherwise false. SyntaxThe has() method is represented by the following syntax: Parameterkey - It represents the key to be searched. ReturnA Boolean value. JavaScript Map has() method exampleHere, we will understand has() method through various examples. Example 1Let's see an example to determine whether the map object contains the specified key. Test it NowOutput: true Example 2Let's see one more example to determine whether the map object contains the specified key. Test it NowOutput: false Example 3Let's see the result when has() method is used without specifying key. Test it NowOutput: false false Next TopicJavaScript Math |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India