Return vs. Paste vs. Print vs. Cat

Re: Return vs. Paste vs. Print vs. Cat

by Erik Spence -
Number of replies: 0
It is only necessary to return a value from a function when you want to get the value out of the function and use it somewhere else. Otherwise you may use print or cat to print out a message of some kind. However, DO NOT use print as a substitute for return. If you are intending to return a value, then return it. Don't print it and accidentally return it as well, which is a side-effect of using print at the end of a function.