-- Equivalent to JavaScript array.includes(searchElement) or-- array.includes(searchElement, fromIndex), except fromIndex is 1 indexedreturn function (array, searchElement, fromIndex) if type(array) ~= 'table' then return false end fromIndex = tonumber(fromIndex) if fromIndex then if (fromIndex < 0) then fromIndex = #array + fromIndex + 1 end if fromIndex < 1 then fromIndex = 1 end for _, v in ipairs do if v
searchElement then return true end end end return falseend