Top "Scope" questions

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

How to force addition instead of concatenation in javascript

I'm trying to add all of the calorie contents in my javascript like this: $(function() { var data = []; $( "#draggable1" ).draggable(); $( "#draggable2" ).…

jquery scope concatenation addition
AngularJS: How to pass arguments/functions to a directive?

Look at this Fiddle, what do I have to change, that the expressions in the template get evaluated using the …

javascript html controller scope angularjs
scopes with lambda and arguments in Rails 4 style?

I'm wondering how the following is done in Rails 4 or if I just use the Rails 3 approach for using a …

ruby-on-rails-4 scope rails-activerecord
Scoping in Python 'for' loops

I'm not asking about Python's scoping rules; I understand generally how scoping works in Python for loops. My question is …

python scope
Spring Java Config: how do you create a prototype-scoped @Bean with runtime arguments?

Using Spring's Java Config, I need to acquire/instantiate a prototype-scoped bean with constructor arguments that are only obtainable at …

java spring scope prototype spring-java-config
Bash variable scope

Please explain to me why the very last echo statement is blank? I expect that XCODE is incremented in the …

bash scope pipe
How can I return a variable from a $.getJSON function

I want to return StudentId to use elsewhere outside of the scope of the $.getJSON() j.getJSON(url, data, function(…

javascript jquery ajax scope return-value
Can't access global variable inside function

This (simplified version of my code) doesn't work: <?php $sxml = new SimpleXMLElement('<somexml/>'); function foo(){ $…

php variables scope global-variables
How to access outer class from an inner class?

I have a situation like so... class Outer(object): def some_method(self): # do something class Inner(object): def __init__(…

python scope nested inner-classes
Define all functions in one .R file, call them from another .R file. How, if possible?

How do I call functions defined in abc.R file in another file, say xyz.R? A supplementary question is, …

r file scope namespaces user-defined-functions