diff --git a/functional.lua b/functional.lua index 8165652..d6748d2 100644 --- a/functional.lua +++ b/functional.lua @@ -31,6 +31,7 @@ end --simple sequential iteration, f is called for all elements of t --f can return non-nil to break the loop (and return the value) +--otherwise returns t for chaining function functional.foreach(t, f) for i = 1, #t do local result = f(t[i], i)