Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Select your favorite languages :
  • Or search :

Idiom #276 Insert an element in a set

Insert an element e into the set x.

x.add(e);
x[e] = struct{}{}
x[e] = true
x.add(e);
import java.util.Set;
x.add(e)
Include(x,e);
x := x + [e];
x.add(e)
require 'set'
x.add(e)
x << e

New implementation...