Mutation Operators: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 17: Line 17:
score+=1  -- faster and less typing than score=score+1</source>
score+=1  -- faster and less typing than score=score+1</source>
{|-
{|-
| style="width: 50%;"|
| style="width: 50%; vertical-align:top;"|
=== Methods ===
=== Methods ===
| style="width: 50%;"|
| style="width: 50%; vertical-align:top;"|
=== Events ===
=== Events ===
=== Constants ===
=== Constants ===
|}
|}

Revision as of 13:31, 23 August 2018

Supported platforms: android, ios, mac, pc
Available since: Gideros 2017.11

Description


Operators to mutate a value.

a += b   Add 'b' to 'a'.
a -= b   Subtract 'b from 'a'.
a *= b   Multiply 'a' by 'b', result in 'a'.
a /= b   Divide 'a' by 'b', result in 'a'.
a %= b   The result of 'a%b' is placed in 'a'.
a ^= b   The result of 'a^b' is placed in 'a'. ^ is faster than a=math.pow(a,b)

Examples

Simple larger example

 
score+=1  -- faster and less typing than score=score+1

Methods

Events

Constants