I just found an answer on the forum where the guy defines the data type for a function, and returns a value at the end of the function,it goes like this:
function MaxValue (intArray : int[]) : int {
var max = intArray[0];
for (i = 1; i < intArray.Length; i++) {
if (intArray[i] > max) {
max = intArray[i];
}
}
return max;
}
what is the point in declaring the function datatype? is it related to the return command at the end of the function?
↧