79508041

Date: 2025-03-14 02:46:17
Score: 1
Natty:
Report link

My favorite pattern for this is:

let val = map.get(key)
if (!val) map.set(key, val = defaultVal)

I like this because it lines up.

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: user29889977