Variable Modifiers
Variable modifiers allow you to work directly with a variable, making your code look more logical and easier to follow, as well as taking less time to type out. A variable modifier would look like this:
<variable>.<modifier>(<arguments>);
Variable modifiers still execute the original functions (i.e. the above is using the add() function), although we drop the first argument of the function and ensure all other arguments are provided.
In some cases, variable modifiers will also store the result directly to the original variable as well, therefore the following is invalid:
The following functions are acceptable variable modifiers (ensure the types are correct):
add
sub
mul
concat
mod
div
length
get
pop
drop
in
push
Last updated