How to increment an object property value if it exists, else set the initial value? May 9, 2023 by Tarik dict[key] = (dict[key] || 0) + 1;