With computed property names in object literals, symbols are very easy to work with.
对于对象字面量中的计算的属性名字,使用标志很容易。
I raise the same objection to the recommendations for using object literals, RegExp literals, and so forth.
我还对推荐使用Object字面值、RegExp字面值等等都提出相同的异议。
This does not apply to the comma separator, which is used in object literals, array literals, var statements, and parameter lists.
这不包括那些被用在对象定义,数组定义,var语句,和参数列表中的逗号分隔符。
Also, as with object literals, the elements in array literals can be arbitrary expressions and need not be restricted to constants.
而且,与数据直接量相同,数组直接量中的元素不必仅限于常量,它可以是任意的表达式。
Alternately, you can declare a kind of object using the all-purpose instantiator var, which may use literals to define internal structures.
或者,我们可以声明一个使用通用实例的对象,它可能要用常量来定义内部结构,然后我们可以选择一个常量来为这个函数赋值,以使其具备变量的特征。
As the number of object properties and array items increases, so too does the benefit of using literals.
随着对象属性和数组项数的增加,使用直接量的好处也随之增加。
As the number of object properties and array items increases, so too does the benefit of using literals.
随着对象属性和数组项数的增加,使用直接量的好处也随之增加。
应用推荐