In JavaScript, if I want to return a variable but don\'t want to modify it or leak it into the global scope, can I define and return it on one line like this?
re
I cannot see why you would want to do that since once you return you are out of scope.
return
Just do
return 'bar';