The [set->insert] method inserts the specified value into the set. The set is modified in-place and no result is returned.
set->insert( value )
Use the [set->insert] method. This example adds all of the elements of an array to a set.
Note: Since a set can only contain one of any given element, this is a simple method for removing duplicates from an array or map.
Code
var( days = array('Mon','Tues','Fri','Tues','Sun','Sat','Mon'),
myDays = set )
$days->forEach => {
$myDays->insert(#1)
}
$myDays
Result
set(Fri, Mon, Sat, Sun, Tues)
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments