Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The sum function will get the sum of an array. 

Return Value

Value returns a sum of parent array.

Error Handling

If you try and sum an array which is not numeric values, the function will crash.

Example
pjs.define("Num", { type: 'integer', length: 10, dim: 5 });
 
Num[1] = 1;
Num[2] = 2;
Num[3] = 3;
Num[4] = 4;
Num[5] = 5;
 
return Num.sum();
//15
  • No labels