JavaScript: Map.prototype.clear
New in JS2015.
mapObj.clear()
-
Deletes all entries.
Return undefined.
const xx = new Map([[3, "n3"], [4, "n4"], [5, "n5"]]); // clear map, return undefined console.log(xx.clear() === undefined); // cleared console.log(xx.size === 0);