Prevent mistake when check existence with .has()
, but .get()
or .set()
with another key, I believe this is mistake in most cases. Especially in ternary.
const foo = map.has(key) ? map.get(anotherKey) : value;
if (!map.has(key)) {
const foo = map.get(anotherKey);
}
if (!map.has(key)) {
map.set(anotherKey, value);
}
const foo = map.has(key) ? map.get(key) : value;
if (map.has(key)) {
map.set(key, value);
map.set(anotherKey, value);
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too