preincrement
preincrement(s_var) =>n_result
Description
Takes a variable, increments its value by one, stores the new value back into the variable, and returns the new value. This function is a prefix form of ++s. The name of the variable must be a symbol and the value must be a number.
Arguments
Value Returned
Examples
s = 2
preincrement( s )
=> 3
s => 3
s = 2.2
preincrement( s )
=> 3.2
s => 3.2
Related Topics
Return to top