Returns a new flag box with the flags of first that are absent in every subsequent box (successive AND NOT). Non-commutative: difference(a, b) and difference(b, a) produce different results.
first
difference(a, b)
difference(b, a)
if boxes belong to different registry instances.
const a = registry.of("read", "write", "execute");const b = registry.of("write");const result = difference(a, b);result.has("read"); // trueresult.has("write"); // false — stripped by bresult.has("execute"); // true Copy
const a = registry.of("read", "write", "execute");const b = registry.of("write");const result = difference(a, b);result.has("read"); // trueresult.has("write"); // false — stripped by bresult.has("execute"); // true
Returns a new flag box with the flags of
firstthat are absent in every subsequent box (successive AND NOT). Non-commutative:difference(a, b)anddifference(b, a)produce different results.