myNums = [1,90,50,32]mySquared = (num**2for num in myNums)for i in mySquared:print(i)
is valid code now even after compiling to Luau.
local myNums = {1, 90, 50, 32}local mySquared = (function() local result = {} for num in myNums do table.insert(result, (num ^ 2)) end return result end)()
for i in mySquared doprint(i)end
Dictionary and List comprehension is also supported.