Basically, I’m trying to compare the value of a table with another table and get the result.
local alphabet = {"A","B","C","D","E","F","G"} local letters = {"A","C", "F"} local newLetters = {} for i=1,#letters do if letters[i] == alphabet[i] then newLetters[#newLetters +1] = alphabet[i] table.remove(letters, i) end end return newLetters
This only returns “A”. What’s wrong with this code?