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.

try {} without catch {} possible in JavaScript?

I have a number of functions which either return something or throw an error. In a main function, I call …

javascript function try-catch return
return false from jQuery click event

I have click events set up like this: $('.dialogLink') .click(function () { dialog(this); return false; }); The all have a "…

jquery return jquery-events
How to return smart pointers (shared_ptr), by reference or by value?

Let's say I have a class with a method that returns a shared_ptr. What are the possible benefits and …

c++ return smart-pointers
Return errors from PHP run via. AJAX?

Is there a way to get PHP to return an AJAX error code if the PHP script fails somewhere? I …

php ajax return
What's the best way to return multiple values from a function in Python?

I have a function where I need to do something to a string. I need the function to return a …

python variables return
return statement vs exit() in main()

Should I use exit() or just return statements in main()? Personally I favor the return statements because I feel it's …

c++ c coding-style return exit
Syntax: "Exit Sub" or "Return" in VB.NET subroutines

Both "Exit Sub" or "Return" seem to accomplish the same thing -- exit a subroutine. Is there any difference in …

vb.net syntax return subroutine
what is the point of return in Ruby?

What is the difference between return and just putting a variable such as the following: no return def write_code(…

ruby return
Is it better to return `undefined` or `null` from a javascript function?

I have a function which I have written which basically looks like this: function getNextCard(searchTerms) { // Setup Some Variables // Do …

javascript function null return undefined
When should I use `return` in es6 Arrow Functions?

The new es6 arrow functions say return is implicit under some circumstances: The expression is also the implicit return value …

javascript function return ecmascript-6 arrow-functions