To remove all elements from a Map, use the .clear() method:
.clear()
map.clear();
Example:
const map = new Map([[1, 2], [3, 4]]); console.log(map.size); // 2 map.clear(); console.log(map.size); // 0 console.log(map.get(1)); // undefined