1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-hashset_has.md
2022-06-06 13:11:46 +08:00

559 B

hashset_has

Returns true if a util/set/hashset contains the specified element.

Since: 3.0

Parameters

  • set : The original set.
  • elem : The element to be checked.
  • eq : A equality function. If it's ignored, use == to compare elements.
  • hash : A hash function. If it's ignored, convert each element to a string and hash it.

Examples

use <util/set/hashset.scad>
use <util/set/hashset_has.scad>

s = hashset([1, 2, 3, 4, 5]);
assert(hashset_has(s, 3));