Function calls

  • Updated

irScript supports invocation of function objects and member functions, using a named reference to the function.

function myFunc ( arg1 ) { return arg1.ToString(); }

var x = myFunc( 34 );

var y = { MyMemberFunc : myFunc };

var z = y.MyMemberFunc( [true, false, 34.4] );

All function calls in irScript return a value; functions that don’t return an explicit value implicitly return null, the value of which can be safely ignored.

function someFunc ( arg ) { arg.Name = 'Fred'; }

var x = { Age : 78 };

var y = someFunc( x );       // y == null

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.