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

  • 相关阅读:
    spring查看生成的cglib代理类源码详解
    java-jdk动态代理生成的代理类源码
    约瑟夫斯问题-java版数组解法和链表解法
    HashMap源码解析(简单易懂)
    windows云服务器发布项目
    java学习
    TTL macro登陆linux服务器
    c#笔记
    C#笔记
    git merge
  • 原文地址:https://www.cnblogs.com/rsapaper/p/5805263.html
Copyright © 2011-2022 走看看