Add comment to foreach regarding new behaviour

This commit is contained in:
Sheepolution 2022-03-01 03:01:39 +01:00 committed by GitHub
parent 3c6aaf1a76
commit f36946ace4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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