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)建立后才会进行上面的两步。

  • 相关阅读:
    Java中File类的使用
    Java集合中Comparator和Comparable接口的使用
    ODP.NET
    DllImport
    .net 项目与网站区别
    sqlserver 2012 分页
    sqlserver 分页
    ORACLE 中ROWNUM
    mysql 分页优化
    mysql windows 安装
  • 原文地址:https://www.cnblogs.com/argb/p/2099298.html
Copyright © 2011-2022 走看看