Three copies of a discount form on the counter: ||=, &&= and ??= side by side with x = x || y, and a counting setter and fallback show who really writes. An…
Filling defaults (??=), setting up an expensive cache only once (??= skips the work when it is there), updating only what exists (&&=). Picking ||= over ??= is a classic bug: a valid 0 or empty text is silently overwritten.
Short-circuiting assignment: when the test fails, nothing is written
||= for a default when 0 or empty text is valid opts.count ||= 10 turns 0 into 10. Use ??= so it only fills null or undefined.x ??= f() does not call f() when x is there. Do not put a side effect that must happen on the right side.&&= is for It means "overwrite only when already truthy", for example el &&= el.trim() only works on el when it is there and not empty.||= overwrite a 0 0 is falsy, so ||= writes the fallback.??= keep the 0 0 is not nullish: left alone.&&= on a value that is there &&= overwrites only what is truthy.