Module:TableTools: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
imported>Sukanthi
சி 1 திருத்தம் இறக்குமதி செய்யப்பட்டன
imported>Ravidreams
சி en:Module:TableTools இலிருந்து திருத்தம் இறக்குமதி செய்யப்பட்டன
 
வரிசை 460:
-- inArray
--
-- Returns true if valueToFindsearchElement is a member of the array, and false otherwise.
-- Equivalent to JavaScript array.includes(searchElement) or
-- array.includes(searchElement, fromIndex), except fromIndex is 1 indexed
------------------------------------------------------------------------------------
function p.inArray(arrarray, valueToFindsearchElement, fromIndex)
checkType("inArray", 1, arrarray, "table")
-- if valueToFindsearchElement is nil, error?
 
fromIndex = tonumber(fromIndex)
for _, v in ipairs(arr) do
if v == valueToFindfromIndex then
if (fromIndex < 0) then
return true
fromIndex = #array + fromIndex + 1
end
if fromIndex < 1 then fromIndex = 1 end
for _, v in ipairs({unpack(array, fromIndex)}) do
if v == searchElement then
return true
end
end
else
for _, v in ipairspairs(arrarray) do
if v == searchElement then
return true
end
end
end
"https://tamilar.wiki/w/Module:TableTools" இலிருந்து மீள்விக்கப்பட்டது