Update Assignment

+=, -=, /=, *=, %=, ..=, or=, and= operators have been added for updating and assigning at the same time. They are aliases for their expanded equivalents.

MoonScript:

x = 0
x += 10

s = "hello "
s ..= "world"

b = false
b and= true or false

Lua:

local x = 0
x = x + 10
local s = "hello "
s = s .. "world"
local b = false
b = b and (true or false)

results matching ""

    No results matching ""