Top "Scope" questions

Scope is an enclosing context where values and expressions are associated.

I can pass a variable from a JSP scriptlet to JSTL but not from JSTL to a JSP scriptlet without an error

The following code causes an error: <c:set var="test" value="test1"/> <% String resp = "abc"; resp = resp + …

java jsp jstl scope scriptlet
What is the difference between 'my' and 'our' in Perl?

I know what my is in Perl. It defines a variable that exists only in the scope of the block …

perl scope
What is the purpose of wrapping whole Javascript files in anonymous functions like “(function(){ … })()”?

I have been reading a lot of Javascript lately and I have been noticing that the whole file is wrapped …

javascript scope coding-style iife
JavaScript closures vs. anonymous functions

A friend of mine and I are currently discussing what is a closure in JS and what isn't. We just …

javascript scope closures
Giving my function access to outside variable

I have an array outside: $myArr = array(); I would like to give my function access to the array outside it …

php function scope
var self = this?

Using instance methods as callbacks for event handlers changes the scope of this from "My instance" to "Whatever just called …

javascript jquery scope closures
What is the meaning of the dollar sign "$" in R function()?

Through learning R, I just came across the following code explained here. open.account <- function(total) { list( deposit = …

r function scope lexical-scope
Is it possible to define more than one function per file in MATLAB, and access them from outside that file?

When I was studying for my undergraduate degree in EE, MATLAB required each function to be defined in its own …

matlab function file scope function-declaration
Is there a reason for C#'s reuse of the variable in a foreach?

When using lambda expressions or anonymous methods in C#, we have to be wary of the access to modified closure …

c# foreach lambda scope anonymous-methods
Global javascript variable inside document.ready

Which is the right way of declaring a global javascript variable? The way I'm trying it, doesn't work $(document).ready(…

javascript jquery global-variables scope