Questions tagged as 'escopo-de-variáveis'

3
answers

How to use the current value of a variable in an inner function?

The following code "prints" 50 times the text "Message 50" in a textarea . for (var i = 0; i < 50; i++) { setTimeout(function() { textArea.value += 'Mensagem ' + i + '\n'; textArea.scrollTop = textArea.scrollHeig...
asked by 27.12.2013 / 14:47
3
answers

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?     
asked by 15.04.2014 / 18:21
4
answers

What is the difference between declaring variables using let and var?

Since the word let was introduced in ECMAScript I have only heard about it, so far I have not seen any practical examples and to be honest I do not know very well what a let variable is and how it behaves. The only thing I unders...
asked by 16.01.2015 / 13:56