escopo-de-variáveis

How to use the current value of a variable in a more internal function?

The following code "prints" 50 times the text "message 50" in a textarea. for (var i = 0; i < 50; i++) { setTimeout ... at the time the function Internal was created in the call of setTimeout, resulting in texts from " Message 0 "to"message 49"

What is the difference between global and superglobal variables?

I read some time ago that PHP has the vast majority of its variables declared with local scope. But I found two other conce ... en them. What is the difference between global and super global variables? when should one (ria) use each specific type?

Why does JavaScript allow to use variables without declaring?

Was doing a test on JSFiddle, with the code below. In it I did not declare the variable i, but still, I can use it normally. ... al scope"? for(i = 0; i < 10; i++){ document.write(i + '<br>'); } i = 'asdasd'; document.write(i);

What are lexical scope and dynamic scope and what are their main differences?

What are lexical scope and dynamic scope and what are their main differences?

What is the difference between scope and lifetime?

What is scope? What is life time? Do they get confused? Visibility has something to do with this too?

How useful is keyword auto in C?

To keyword auto, defined by the C language, it is an ancient and seemingly useless keyword in the language. I know that in C ... ing about macros that might make Keyword auto necessary, but I don't know if that really has anything to do with my question.

Local and global variables Python [closed]

closed. this question is out of scope and is not currently accepting answers. ... x(msg="Insira data início", title="Definir data início") ValidaDataInicio() EscolheDataFim()

Referencing Python Variables

I'm learning programming on my own and as much as I search online, I can't understand exactly why the following reference doe ... rmat, for some reason the reference works, but I wanted this greeting to be method independent. I appreciate your attention.

Difference between global and local scope

I have recently come across the concept of global and local scope and, I am having great difficulty understanding them in terms of conceptualization. What would be scope in its definition, and global and local scope?

Global variable in JavaScript

How to make a global variable in JavaScript? I need the variable that was declared in one function to work in another functi ... ill = "a"; }); $("#div2").click(function() { alert(fill); }); When I click on #div3 the variable works on alert of #div2!

Use of IIFE in ES6

In ES5 it is considered good practice to use IIFE to force a local scope in our code. EX: (function(){ // some code })(); In ES6 is this still necessary? Once the keyword let has been introduced for variable declaration? Thank you.

Declare array in class not knowing it will be its size

How to declare an array within a class, even if you don't know what size it will be and leave it accessible by the entire pro ... : invalid use of non-static data member ‘grafo::tx’ int pgrafo[tx][ty]; ^~ }; How to solve this problem ?

What is the difference between variable declaration using LeT and var?

Since the word let was introduced in ECMAScript I have only heard about it, until then I have not seen any practical example ... are a local variable, something related to scope. What are variables let? What are they for? When to use them instead of var?