Return keyword


#1

i dont see the return words on the right screen, why?


#2

Could you give an example? Also return is not a command that writes to the screen it just returns the value to the program meaning if you use return you can use the function call as an alias for what is returned e.g.

Math.random() returns a random number and wherever you need that number you could just use Math.random(). But this doesn't mean that the random number is shown on the screen. This only happens if the returned value is the very last value in your program then the console echoes it but this is still rather a feature than a reliable output.


#3

for example: return "rock wins"
where can i see the answer who won the game.?
you say that return is just for the program ?