These are chat archives for effektif/effektif

14th
Mar 2016
Stefano
@esseti
Mar 14 2016 16:23
hello, dunno if it's intended but:
  • i've two script tasks, one following the other.
  • both defines a variable test. so the first can update the value for the second, this works.
  • in the first one i've this code test="234" and then var test="123"
    this prints null . shouldn't it print 234? the local variable is defined after setting the value of the global one.
Jan-Felix
@jfschwarz
Mar 14 2016 16:39
@esseti the var keyword declares a local variable for the whole scope, i.e., the closure, the line position does not matter
Variable declarations, wherever they occur, are processed before any code is executed. The scope of a variable declared with var is its current execution context, which is either the enclosing function or, for variables declared outside any function, global.