I’ve added new short notation for anonymous (lambda functions) in TIScript build #2.0.0.3
Example of such notation – sort array a
in descending order:
a.sort(:v1,v2:v2 - v3);
This is a direct equivalent of:
a.sort( function(v1,v2) { return v2 - v3; } );
Therefore anonymous functions in TIScript can be declared in place in of the three forms:
- classic JavaScript form:
function ( < parameters > ) { < statements > }
- single expression lambda function form
: < parameters > : < statement >;
- “block with parameters” form
: < parameters > { < statements > }