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

a loosely strongly typed language的更多相关文章

  1. Dynamic V Strongly Typed Views

    Come From https://blogs.msdn.microsoft.com/rickandy/2011/01/28/dynamic-v-strongly-typed-views/ There ...

  2. MVC 5 Strongly Typed Views(强类型视图)

    学习MVC这样久以来,发觉网站上很多MVC的视频或是文章,均是使用Strongly Type views来实现控制器与视图的交互.Insus.NET以前发布的博文中,也大量使用这种方式: <Da ...

  3. Delphi Language Overview

    Delphi is a high-level, compiled, strongly typed language that supports structured and object-orient ...

  4. New需谨慎

    New is Glue When you’re working in a strongly typed language like C# or Visual Basic, instantiating ...

  5. 数据库设计(1/9):数据元(Data Elements)

    对于设计和创建数据库完全是个新手?没关系,Joe Celko,世界上读者数量最多的SQL作者之一,会告诉你这些基础.和往常一样,即使是最专业的数据库老手,也会给他们带来惊喜.Joe是DMBS杂志是多年 ...

  6. Core Java Volume I — 3.3. Data Types

    3.3. Data TypesJava is a strongly typed language(强类型语音). This means that every variable must have a ...

  7. Delphi XE5教程1:语言概述

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

  8. Quest for sane signals in Qt - step 1 (hand coding a Q_OBJECT)

    探索qt的信号ref: http://crazyeddiecpp.blogspot.hk/2011/01/quest-for-sane-signals-in-qt-step-1.html If it ...

  9. STL之父Stepanov谈泛型编程的发展史

    这是一篇Dr. Dobb's Journal对STL之父stepanov的采访.文中数次提到STL的基本思想.语言的特性.编程的一些根本问题等,非常精彩.这篇文章让我想去拜读下stepanov的大作& ...

随机推荐

  1. HTML 样式

    style 属性用于改变 HTML 元素的样式,常见的样式如下: 定义字体颜色:style="color:red"定义字体大小:style="font-size:20px ...

  2. 中文解码Unicode

    package com.j1.search.utils; import java.io.UnsupportedEncodingException; import java.net.URLDecoder ...

  3. python --->字典 集合 学习笔记

    1.字典--->创建空字典:dict={} broa=["李宁",”耐克“,“阿迪达斯”,“鱼c工作室”] sloga=[“A”,“B”,“C”,“D”] dict={&qu ...

  4. centos6.4安装 jupyter-notebook

    自上次发布了文章后有些网友就说不能实现效果,根据自己的实验发现确实有此事,那是因为版本的变化问题.这次基于yum仓库里的jupyter notebook 5.0.0版本实现: 系统:最小化安装[习惯性 ...

  5. 在mysql存储过程中拼接sql解决in的字段类型不匹配问题

    一个朋友问我一个问题,他写了一个存储过程,并在存储过程调用了另外一个自定义的函数.该函数返回类型如'1,34,56'的字符串,并将该字符串作为存储过程的select的id条件. begin DECLA ...

  6. Lua学习笔记 入门的两个小程序

    [Hello World]第一个Lua程序将遵循传统做法,打印一句“Hello World”: print("Hello World") [阶乘]下面的程序用于输出输入值对应的阶乘 ...

  7. 浅谈千万级PV/IP规模高性能高并发网站架构

    高并发访问的核心原则其实就一句话“把所有的用户访问请求都尽量往前推”. 如果把来访用户比作来犯的"敌人",我们一定要把他们挡在800里地以外,即不能让他们的请求一下打到我们的指挥部 ...

  8. 【技术分享会】 @第二期 微信开放API简述-0212

    什么是微信开放平台? 微信开放平台作为第三方移动程序提供接口,使用户可将第三方程序的内容发布给好友或分享至朋友圈,第三方内容借助微信平台获得更广泛的传播.从而形成了一种主流的线上线下微信互动营销方式. ...

  9. WP8.1学习系列(第二十四章)——Json解析

    .net已经集成了json解析,类名叫DataContractJsonSerializer DataContractJsonSerializer 类型公开以下成员. 构造函数     名称 说明 Da ...

  10. LeetCode——Implement Trie (Prefix Tree)

    Description: Implement a trie with insert, search, and startsWith methods. Note:You may assume that ...