- reject
- reject
Reject - remove an element from a hash
examples/hashes/reject.cr
planets = { "Mars" => 1, "Jupyter" => 2, "Saturn" => 3, "Earth" => 4, } puts planets.reject("Mars") puts planets puts planets.reject!("Mars") puts planets
{"Jupyter" => 2, "Saturn" => 3, "Earth" => 4} {"Mars" => 1, "Jupyter" => 2, "Saturn" => 3, "Earth" => 4} {"Jupyter" => 2, "Saturn" => 3, "Earth" => 4} {"Jupyter" => 2, "Saturn" => 3, "Earth" => 4}