Top "Return" questions

A return statement causes execution to leave the current subroutine and resume at the point in the code immediately after where the subroutine was called, known as its return address.

Is having a return statement just to satisfy syntax bad practice?

Consider the following code: public Object getClone(Cloneable a) throws TotallyFooException { if (a == null) { throw new TotallyFooException(); } else { try { return …

java return try-catch
sweetAlert preventDefault and return true

I tried sweeAlert plugin, which works perfectly, but I cant figure out how to do default stuff after confirm. $(document).…

jquery return preventdefault sweetalert
node-mysql connection.query() returns undefined

I'm using a node ws server built on einaros/ws. That server has to send queries to a database. For …

javascript node.js return undefined node-mysql
Return statement in an infinite loop

Where does this return statement return to if it is inside this infinite while(1) loop? More importantly, I had no …

c return infinite-loop mplab
C# out parameters vs returns

So I am new to C# and I am having difficulty understanding out. As opposed to just returning something from …

c# reference return out
Java wildcard generic as return warning in Eclipse and SonarQube

private List gridModel; public List getGridModel() { return gridModel; } Eclipse shows a warning: List is a raw type. References to generic …

java generics return sonarqube
PHP recursive function return value

I have written a recursive function in PHP to crop text. The cropped text will have ... attached to the end. …

php recursion return php-gd
Should I write multiple @return tags in javadoc

Say I have a java method that returns an array of strings. Inside the method, I have more than one …

java return javadoc code-documentation
PHP | Remove element from array with reordering?

How can I remove an element of an array, and reorder afterwards, without having an empty element in the array? &…

php arrays pointers return unset
PHP open_basedir - to return value?

I want to return the value of open_basedir in a php script.. how can I do it? If value …

php return open-basedir