Contents

function

  1. first class citizen:
    1. passed as an argument;
    2. be returned as result of funtions;;
    3. assigned to a variable
  1. have no name;
  1. what? 一块区域,在这个区域声明的变量只在这个区域(以及下级区域)可见

  2. types:

    1. block scope: in block;
    2. function scope: in funciton
    3. gloabl scope: global
  3. lexical scope/ static scope vs dymanic scop

    1. 编译时决定了变量可见范围
    2. 运行时再决定变量可见范围