Pada artikel kali ini, kita akan membahas objek Peta yang disediakan oleh ES6. Peta adalah kumpulan elemen di mana setiap elemen disimpan sebagai Kunci, pasangan nilai. Objek peta dapat menyimpan objek dan nilai primitif sebagai kunci atau nilai. Saat kita mengulangi objek peta, ia mengembalikan kunci, pasangan nilai dalam urutan yang sama seperti yang disisipkan Show Sintaksis. new Map([it]) Parameter: it - It is any iterable object whose values are stored as key, value pair, If the parameter is not specified then a new map is created is Empty Returns: A new Map object Sekarang mari kita buat beberapa Peta menggunakan objek Peta Javascriptmap1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object4 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.0 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.5 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.7 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.9 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined1 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined7 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false0 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false5 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false7 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false9 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.clear(); Parameters: No parameters Returns: undefined2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.5 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.clear(); Parameters: No parameters Returns: undefined7 map1.clear(); Parameters: No parameters Returns: undefined8 map1.clear(); Parameters: No parameters Returns: undefined9 map1.entries(); Parameters: No parameters Returns: It returns an iterator object0 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object3 map1.clear(); Parameters: No parameters Returns: undefined8 map1.entries(); Parameters: No parameters Returns: It returns an iterator object5 map1.entries(); Parameters: No parameters Returns: It returns an iterator object0 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.clear(); Parameters: No parameters Returns: undefined8 map1.keys(); Parameters: No parameter Returns: An iterator object1 map1.keys(); Parameters: No parameter Returns: An iterator object2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6________60______8 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.values(); Parameters: No parameter Returns: An iterator object1 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.values(); Parameters: No parameter Returns: An iterator object5 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.values(); Parameters: No parameter Returns: An iterator object7 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.values(); Parameters: No parameter Returns: An iterator object9 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.forEach(callback, [thisArgument]); Parameters: callback - It is a function that is to be executed for each element of the Map. thisargument - Value to be used as this when executing the callback. Returns: undefined1 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.forEach(callback, [thisArgument]); Parameters: callback - It is a function that is to be executed for each element of the Map. thisargument - Value to be used as this when executing the callback. Returns: undefined4 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.5 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.forEach(callback, [thisArgument]); Parameters: callback - It is a function that is to be executed for each element of the Map. thisargument - Value to be used as this when executing the callback. Returns: undefined9 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object00 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object03 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object07 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object08 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object14 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object17 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object20 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object22 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object24 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object26 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object29 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.5 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_34 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object36 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object38 map1.entries(); Parameters: No parameters Returns: It returns an iterator object0 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object34 map1.clear(); Parameters: No parameters Returns: undefined6 map1.clear(); Parameters: No parameters Returns: undefined9 map1.clear(); Parameters: No parameters Returns: undefined8 map1.entries(); Parameters: No parameters Returns: It returns an iterator object5 map1.keys(); Parameters: No parameter Returns: An iterator object2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object0 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object34 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object52 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object54 map1.entries(); Parameters: No parameters Returns: It returns an iterator object0 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_34 map1.clear(); Parameters: No parameters Returns: undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object58 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object60 map1.keys(); Parameters: No parameter Returns: An iterator object2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.keys(); Parameters: No parameter Returns: An iterator object2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object69 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object72 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 Keluaran. Properti. Peta. prototipe. size – Ini mengembalikan jumlah elemen atau pasangan kunci-nilai di peta Metode. 1. Peta. prototipe. set() – Ini menambahkan kunci dan nilai ke Objek Peta. Sintaksis. map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_ 2. Peta. prototipe. has() – Ini mengembalikan nilai boolean tergantung pada apakah kunci yang ditentukan ada atau tidak Sintaksis. map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._ 3. Peta. prototipe. get() – Ini mengembalikan nilai kunci yang sesuai Sintaksis. map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined 4. Peta. prototipe. delete() – Ini menghapus baik kunci maupun nilai dari peta. Sintaksis. map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false 5. Peta. prototipe. clear() – Menghapus semua elemen dari objek Peta Sintaksis. map1.clear(); Parameters: No parameters Returns: undefined Mari gunakan semua metode yang dijelaskan di atas. Contoh. Javascriptmap1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object76 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object78 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object86 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object36 map1.clear(); Parameters: No parameters Returns: undefined8 map1.clear(); Parameters: No parameters Returns: undefined9 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object38 map1.clear(); Parameters: No parameters Returns: undefined8 map1.entries(); Parameters: No parameters Returns: It returns an iterator object5 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.clear(); Parameters: No parameters Returns: undefined8 map1.keys(); Parameters: No parameter Returns: An iterator object1 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object52 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object60 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object54 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object58 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object4 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.21 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.23 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.25 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.27 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.29 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false0 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.34 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.37 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.40 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.41 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._42 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.43 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.48 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.51 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.41 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.42 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.43 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.55 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.60 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.63 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.66 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.41 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._42 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.69 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.74 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.77 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.41 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._42 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.69 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.55 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.85 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.90 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.92 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.95 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.42 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.97 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.98 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.99________49______9 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._6 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined04 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.40 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.41 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false._42 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.43 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined17 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.95 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.41 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.42 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined23 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.98 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.99 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.55 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.45 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined31 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined33 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined35 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3________20______38 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false0 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 Keluaran. 6. Peta. prototipe. entri() – Mengembalikan objek iterator yang berisi pasangan kunci/nilai untuk setiap elemen yang ada di objek Peta. Sintaksis. map1.entries(); Parameters: No parameters Returns: It returns an iterator object 7. Peta. prototipe. keys() – Ini mengembalikan objek iterator yang berisi semua kunci yang ada di Objek Peta. Sintaksis. map1.keys(); Parameters: No parameter Returns: An iterator object 8. Peta. prototipe. values() – Ini mengembalikan objek iterator yang berisi semua nilai yang ada di Objek Peta. Sintaksis. map1.values(); Parameters: No parameter Returns: An iterator object Mari gunakan semua metode yang dijelaskan di atas. Contoh. Javascriptmap1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object78 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object86 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object36 map1.clear(); Parameters: No parameters Returns: undefined8 map1.clear(); Parameters: No parameters Returns: undefined9 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object38 map1.clear(); Parameters: No parameters Returns: undefined8 map1.entries(); Parameters: No parameters Returns: It returns an iterator object5 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.clear(); Parameters: No parameters Returns: undefined8 map1.keys(); Parameters: No parameter Returns: An iterator object1 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object52 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object60 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object54 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object58 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined86 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3________20______89 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined92 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined96 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined98 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false00 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false02 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false04 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false09 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false12 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.99 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false15 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false17 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false20 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false23 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false26 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined96 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false31 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false33 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false36 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false12 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.99 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false42 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false17 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false47 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false50 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false53 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false56 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false58 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false60 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false63 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false12 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.99 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false69 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false17 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 Keluaran. 9. Peta. prototipe. forEach() – Mengeksekusi fungsi panggilan balik satu kali untuk setiap pasangan kunci/nilai di Peta, dalam urutan penyisipan. Sintaksis. map1.forEach(callback, [thisArgument]); Parameters: callback - It is a function that is to be executed for each element of the Map. thisargument - Value to be used as this when executing the callback. Returns: undefined Fungsi panggilan balik disediakan dengan tiga parameter sebagai berikut.
Contoh Javascriptmap1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false75 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object78 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object83 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false85 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object36 map1.clear(); Parameters: No parameters Returns: undefined8 map1.clear(); Parameters: No parameters Returns: undefined9 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object38 map1.clear(); Parameters: No parameters Returns: undefined8 map1.entries(); Parameters: No parameters Returns: It returns an iterator object5 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.clear(); Parameters: No parameters Returns: undefined8 map1.keys(); Parameters: No parameter Returns: An iterator object1 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object52 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object60 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object54 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object58 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined18 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined20 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined22 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.clear(); Parameters: No parameters Returns: undefined24 map1.clear(); Parameters: No parameters Returns: undefined25 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined27 ________41 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_41_______29 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined31 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined34 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined36 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.clear(); Parameters: No parameters Returns: undefined39 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined42 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined18 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined47 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined49 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined24 map1.clear(); Parameters: No parameters Returns: undefined52 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined27 map1.clear(); Parameters: No parameters Returns: undefined28 map1.clear(); Parameters: No parameters Returns: undefined56 map1.clear(); Parameters: No parameters Returns: undefined57 map1.clear(); Parameters: No parameters Returns: undefined58 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined31 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined63 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined65 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.clear(); Parameters: No parameters Returns: undefined68 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined71 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined18 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined76 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined24 map1.clear(); Parameters: No parameters Returns: undefined79 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined27 ________41 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_41_______83 ________41 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_41_______85 map1.clear(); Parameters: No parameters Returns: undefined28 map1.clear(); Parameters: No parameters Returns: undefined56 map1.clear(); Parameters: No parameters Returns: undefined57 map1.clear(); Parameters: No parameters Returns: undefined58 ________41 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_41_______91 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined31 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false_83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined96 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.clear(); Parameters: No parameters Returns: undefined98 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object01 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object04 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 Keluaran Catatan. Dalam contoh di atas kami menggunakan fungsi panggilan balik sederhana yang hanya mencetak elemen di konsol, itu dapat dirancang untuk melakukan operasi kompleks apa pun sesuai kebutuhan 10. Peta. prototype[@@iterator]() – Mengembalikan fungsi Map iterator yang merupakan metode entri() dari objek Peta secara default. Sintaksis. map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_0 Contoh. Javascriptmap1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object08 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object78 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.4 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object86 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object36 map1.clear(); Parameters: No parameters Returns: undefined8 map1.clear(); Parameters: No parameters Returns: undefined9 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object38 map1.clear(); Parameters: No parameters Returns: undefined8 map1.entries(); Parameters: No parameters Returns: It returns an iterator object5 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object88 map1.entries(); Parameters: No parameters Returns: It returns an iterator object9 map1.clear(); Parameters: No parameters Returns: undefined8 map1.keys(); Parameters: No parameter Returns: An iterator object1 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object52 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object60 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.04 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object54 map1.clear(); Parameters: No parameters Returns: undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object58 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined8 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object51 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object53 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.entries(); Parameters: No parameters Returns: It returns an iterator object56 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined96 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined98 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false00 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false02 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false04 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false06 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.delete(k); Parameters: k - Key which is to be deleted from the map Returns: true if the value is found and deleted from the map otherwise, it returns false12 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.99 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.2 map1.entries(); Parameters: No parameters Returns: It returns an iterator object74 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object76 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 Keluaran. 11. Peta digunakan untuk mengulang array Sintaksis map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_1 Contoh Javascriptmap1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_2 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object80 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object83 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object86 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object88 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object91 map1.entries(); Parameters: No parameters Returns: It returns an iterator object92 map1.entries(); Parameters: No parameters Returns: It returns an iterator object93 map1.entries(); Parameters: No parameters Returns: It returns an iterator object94 map1.has(k); Parameters: k - Key of the element to checked Returns: true if the element with the specified key is present or else returns false.6 map1.entries(); Parameters: No parameters Returns: It returns an iterator object96 map1.entries(); Parameters: No parameters Returns: It returns an iterator object97 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.entries(); Parameters: No parameters Returns: It returns an iterator object99 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.keys(); Parameters: No parameter Returns: An iterator object02 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.keys(); Parameters: No parameter Returns: An iterator object04 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.keys(); Parameters: No parameter Returns: An iterator object07 map1.keys(); Parameters: No parameter Returns: An iterator object08 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_3 map1.keys(); Parameters: No parameter Returns: An iterator object10 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object3 map1.get(k); Parameters: k - Key, whose value is to be returned Returns: The value associated with the key, if it is present in Map, otherwise returns undefined6 map1.keys(); Parameters: No parameter Returns: An iterator object13 map1.keys(); Parameters: No parameter Returns: An iterator object14 map1.set(k, v); Parameters: k - Key of the element to be added to the Map v - value of the element to be added to the Map Returns: It returns a Map object_73 Keluaran
Catatan. - Kita dapat membuat pengguna mendefinisikan iterable daripada menggunakan yang default Referensi. https. // pengembang. mozilla. org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Peta JavaScript terkenal untuk pengembangan halaman web tetapi juga digunakan di berbagai lingkungan non-browser. Anda dapat mempelajari JavaScript dari awal dengan mengikuti Tutorial JavaScript dan Contoh JavaScript ini Berapa kompleksitas waktu peta di JS?Saat ini, kompleksitas waktu adalah O(n) , waktu linier, di mana n adalah ukuran larik fahrenheit. Kemudian kami menerapkan hasil fungsi peta ke fungsi filter.
Berapa kompleksitas waktu dari fungsi peta?Kapasitas Apakah peta lebih cepat daripada objek JavaScript?Map lebih cepat daripada Object kecuali Anda memiliki bilangan bulat kecil, kunci indeks array , dan lebih hemat memori.
Berapa kompleksitas waktu metode HashMap get () dan put ()?penyisipan dan pengambilan HashMap membutuhkan waktu O(1) waktu. HashMap menyimpan nilai dalam key-value pair.
Apa itu metode peta () dalam JavaScript?map() membuat larik baru dari pemanggilan fungsi untuk setiap elemen larik . map() memanggil fungsi satu kali untuk setiap elemen dalam array. map() tidak menjalankan fungsi untuk elemen kosong. map() tidak mengubah array asli.
Apa kerumitan HashMap?HashMap memiliki kompleksitas O(1) untuk penyisipan dan pencarian. HashMap memungkinkan satu kunci nol dan beberapa nilai nol. |