BoxSetRemove
Remove an element from a Set.
If the value is not present the call is a no-op. The Set is modified in place and returned to support method chaining.
Method Signature
BoxSetRemove(set=[modifiableSet], value=[any])Arguments
Argument
Type
Required
Description
Default
set
modifiableSet
true
The set to remove from.
value
any
true
The value to remove. If the value is not present, the call is a no-op.
Examples
Remove a single element
If the element is not present, the Set is unchanged.
s = [ 1, 2, 3 ].toSet();
s.remove( 2 );
writeOutput( s.size() );
Result: 2
Using the delete alias
delete is an alias for remove.
Result: 2
Related
Last updated
Was this helpful?
