BoxSetAdd
Add an element to a Set, deduplicating automatically.
If the value is already present, the call is a no-op. The Set is modified in place and returned to support method chaining.
Method Signature
BoxSetAdd(set=[modifiableSet], value=[any])Arguments
Argument
Type
Required
Description
Default
set
modifiableSet
true
The set to add the element to.
value
any
true
The value to add. Duplicates are silently ignored.
Examples
Add elements using the add member function
s = setNew();
s.add( "apple" );
s.add( "banana" );
s.add( "apple" );
writeOutput( s.size() );
Result: 2
Using the append alias
append is an alias for add.
Result: 2
Related
Last updated
Was this helpful?
