From 256156a424bb1ebb41968c4a95573a0e8161d7f7 Mon Sep 17 00:00:00 2001 From: aName Date: Wed, 8 May 2024 18:46:12 +0000 Subject: [PATCH] fully implemented gs:sets module --- .gsmodules/set.g | 4 +--- tests/main.g | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gsmodules/set.g b/.gsmodules/set.g index fb310a8..6934dea 100644 --- a/.gsmodules/set.g +++ b/.gsmodules/set.g @@ -12,9 +12,7 @@ export class Set { } public has(v) { - let hasValue = false; - - for (let i = 0; i < ) + return Array.has(this.arr, v); } public getAll() { diff --git a/tests/main.g b/tests/main.g index 2cb2abe..3d737f8 100644 --- a/tests/main.g +++ b/tests/main.g @@ -7,3 +7,6 @@ set.add(3) set.add(4) print(set.getAll()) + +print(set.has(3)) +print(set.has(5))