mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-16 20:21:22 +08:00
doc: Update lua.md fix #956
This commit is contained in:
@ -197,7 +197,11 @@ t.n = t.n + 1 -- 改变 table
|
||||
|
||||
```lua
|
||||
-- 给多个变量赋值
|
||||
a, b = 10, 2*a --> a=10; b=20
|
||||
-- 情况1:a 未定义过
|
||||
a, b = 10, 2*a -- 报错:a 是 nil
|
||||
-- 情况2:a 已定义(比如 a=5)
|
||||
a = 5
|
||||
a, b = 10, 2*a -- 右侧的 a=5,结果 a=10, b=10(不会报错)
|
||||
```
|
||||
|
||||
#### 交换变量
|
||||
|
Reference in New Issue
Block a user