ArrayParser.getReduction() - Mtax-Development/GML-OOP GitHub Wiki

Arguments

Name
Type
Optional
reducer
No
initial_value?
{any}
Yes
argument?
{any}
Yes

Returns

{any} | On error: {undefined}

Description

Execute a function to compare each value in the array with the previous return value and return the final of these values. The comparison starts from either the specified initial value or the first value of the array. The following arguments will be provided to the function and can be accessed in it by using their name or the argument array:
  • argument[0]: _value_previous {any}
  • argument[1]: _value_current {any}
  • argument[2]: _i {int}
  • argument[3]: _argument {any}

⚠️ **GitHub.com Fallback** ⚠️