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

  • 相关阅读:
    快速排序 c++
    编程作业: 感性接触计算机程序
    SAS批量导出sas7bdata至excel
    JetBrains WebStorm 快捷键失效
    grails 解决emoji标签存入mysql
    Groovy使用List集合
    javascript 获取当前部署项目路径
    Groovy基本类型与运算符
    HTML— 弹出遮盖层
    grails 获取domainClassName
  • 原文地址:https://www.cnblogs.com/rsapaper/p/5805263.html
Copyright © 2011-2022 走看看