Top "Scope" questions

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

Static variables in member functions

Can someone please explain how static variables in member functions work in C++. Given the following class: class A { void …

c++ static scope
How should I use the "my" keyword in Perl?

I keep seeing the "my" keyword in front of variable names in example Perl scripts online but I have no …

perl scope declaration
How do I create a static local variable in Java?

I've read Java does not support static local variables unlike C/C++. Now if I want to code a function …

java scope static
Python nested functions variable scoping

I've read almost all the other questions about the topic, but my code still doesn't work. I think I'm missing …

python variables scope
namespaces for enum types - best practices

Often, one needs several enumerated types together. Sometimes, one has a name clash. Two solutions to this come to mind: …

c++ enums scope nested
How do I pass an extra parameter to the callback function in Javascript .filter() method?

I want to compare each string in an Array with a given string. My current implementation is: function startsWith(element) { …

javascript callback scope
Scope issues with Angular UI modal

I'm having trouble understanding/using the scopes for an angular UI modal. While not immediately apparent here, I have the …

javascript angularjs scope modal-dialog angularjs-scope
Angular JS resizable div directive

My site will have multiple sections, each of which I intend to be resizable. To accomplish this I've made a "…

angularjs controller resize scope directive
Why does assigning to my global variables not work in Python?

I'm having terrible trouble trying to understand python scoping rules. With the following script: a = 7 def printA(): print "Value of …

python global-variables scope
js: accessing scope of parent class

I have a jquery class within a normal class in javascript. Is it possible to access variables in the scope …

javascript jquery class scope parent