zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    复利结对项目 增添
    结对编程-对队友的评价
    复利结对项目
    阅读《构造之法》第4章有感
    单元测试
    实验一 命令解释程序cmd的编写
    阅读《构造之法》1、2、3章有感
    复利计算
    实验总结
    汉堡包评价
  • 原文地址:https://www.cnblogs.com/rsapaper/p/5805263.html
Copyright © 2011-2022 走看看