❌ Instead of: if (map.has(key)) { return map.get(key); } map.set(key, value); return value; ✅ Write: return map.getOrInsert(key, value); This now works in all browsers!
web-platform-dx.github.ioWeb platform features explorer - Map getOrInsert()
7 reposts45 likes