https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/getOrInsert
Map.prototype.getOrInsert() - JavaScript | MDN
The getOrInsert() method of Map instances returns the value corresponding to the specified key in this Map. If the key is not present, it inserts a new entry...
mapprototypejavascriptmdn
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/getOrInsert
WeakMap.prototype.getOrInsert() - JavaScript | MDN
The getOrInsert() method of WeakMap instances returns the value corresponding to the specified key in this WeakMap. If the key is not present, it inserts a new...
weakmapprototypejavascriptmdn