zoukankan      html  css  js  c++  java
  • ECMA262(v5)点滴(一)

     variable statment(变量语句)

    A variable statement declares variables that are created as defined in 10.5. Variables are initialised to undefined when created. A variable with an Initialiser is assigned the value of its AssignmentExpression when the VariableStatement is executed, not when the variable is created.

    这里很很重要的一句:

    A variable with an Initialiser is assigned the value of its AssignmentExpression when the VariableStatement is executed, not when the variable is created.
    可见,如 var a=5;这种形式的语句是分两步进行的:

    第一步,创建 variable a, 保证变量的存在

    第二步,执行,对变量a赋值

    如果像这样

    var a=1 ;

    var b=2;

    var c=3;

    则是:

    第一步 ,创建变量a,b,c,此时他们的值都是undefined

    第二部,对 a,b,c 分别赋值

    注意:

    只有当执行上下文(execution context)建立后才会进行上面的两步。

  • 相关阅读:
    资源网站
    远程服务SSH
    Samba服务配置
    练习raid5
    raid(0、1)
    NFS服务器配置(windows访问)
    LVM磁盘阵列
    ISCSI服务器配置
    Zibbix监控
    MySQL Replication配置
  • 原文地址:https://www.cnblogs.com/argb/p/2099298.html
Copyright © 2011-2022 走看看