JS: Map.prototype.clear
(new in ECMAScript 2015)
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);