There was an error while loading. Please reload this page.
Functions are declared using the following syntax:
func getName(int a, double b, string c, var d){ }
Functions may be overloaded:
func getValue(int b){ return b; } func getValue(double b){ return b; }
If the parameter uses the var type, then this will be the last overloaded function.
var
func getValue(var b){ return b; }
Functions may be nested inside of functions. Where a body of code is, a function may be declared. For example:
func test(){ func test1(){ func test2(){ return 1; } return test2(); } return test1(); }
Functions may have default arguments.
func defaultArgs(int a = 10){ println(a); } defaultArgs();