Quantcast
Channel: Questions in topic: "declare"
Viewing all articles
Browse latest Browse all 78

why function datatype i.e. function foo() : int {

$
0
0
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?

Viewing all articles
Browse latest Browse all 78

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>