• a loosely strongly typed language


    JavaScript: The Definitive Guide, Sixth Edition by David Flanagan

    As explained above, the following two JavaScript expressions have the same value:object.propertyobject["property"].The first syntax, using the dot and an identifier, is like the syntax used to access a staticfield of a struct or object in C or Java. The second syntax, using square brackets and astring, looks like array access, but to an array indexed by strings rather than by numbers.This kind of array is known as an associative array (or hash or map or dictionary).JavaScript objects are associative arrays, and this section explains why that is important.In C, C++, Java, and similar strongly typed languages, an object can have only a fixednumber of properties, and the names of these properties must be defined in advance.Since JavaScript is a loosely typed language, this rule does not apply: a program cancreate any number of properties in any object. When you use the . operator to accessa property of an object, however, the name of the property is expressed as an identifier.Identifiers must be typed literally into your JavaScript program; they are not a datatype,so they cannot be manipulated by the program.

    120|Chapter 6:Objects

  • 相关阅读:
    hdu 1527威佐夫博弈
    hdu 1506
    hdu 1878 欧拉回路
    欧拉回路知识
    hdu 2545 并查集 树上战争
    hdu 2594 kmp
    hdu 1867 kmp匹配
    hdu 2844 多重背包二进制优化
    hdu 4006
    1047
  • 原文地址:https://www.cnblogs.com/rsapaper/p/5805263.html
Copyright © 2020-2023  润新知