Scope

x = 3

def fun1():
    x = 4
    fun2()

def fun2():
    print(x)

fun1()
function  big() {
  function  sub1() {
    var  x = 7;
  }
  function  sub2() {
    var  y = x;
    var  z = 3;
  }
  var  x = 3;
}

if Tex used static scoping, you would have to do this

\it italic text \bf boldface text \it normal text

Closure

Lifetime