Skip to content

Instantly share code, notes, and snippets.

@iris-yeh

iris-yeh/lua.lua Secret

Created May 6, 2021 16:21
-- 寫個簡單的函數
local function func()
print('Hi')
end
--[[新增一個table 裡面塞入一個function 和 string
這邊f就是key,對應的value就是func這個函數
這邊name就是key,對應的value就是iris這個字串 ]]
local aTable = {f = func, name = "iris"}
-- 在table.後面加入key就可以直接使用table中的內容
aTable.f()
print(aTable.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment