使用虛變量(即下劃線)來存儲丟棄不須要的數值。lua
例如:code
function Set (list) local set = {} for _, l in ipairs(list) do print(_,l) end print(set) end Set{"while", "end", "function", "local", }
運行結果:ip
1 while 2 end 3 function 4 local