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. Wcf使用Net.Tcp做回调操作

    契约: [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode = Se ...

  2. 彻底删除weblogic域方法

    1.删除 D:\Oracle\Middleware\wlserver_10.3\common\nodemanager\nodemanager.domains 里的base_domain域内容 #Dom ...

  3. xml文件的序列化示例

    1.创建activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andr ...

  4. spine-unity3D 学习笔记

    http://zh.esotericsoftware.com/spine-using-runtimes //skeletonData SkeletonAnimation skeletonAnimati ...

  5. html中属于布尔类型的属性

    1.noshade,用来表示有无阴影,多用于在<hr />标签当中 2.ckecked,用来表示是否默认选中,多用于单选按钮<input type="radio" ...

  6. 《Lua程序设计》第5章 函数 学习笔记

    Lua为面向对象式的调用也提供了一种特殊的语法——冒号操作符.表达式o.foo(o, x)的另一种写法是o:foo(x),冒号操作符是调用o.foo时将o隐含地作为函数的第一个参数.Lua可以调用C语 ...

  7. [微信小程序]计算自己手机到指定位置的距离

    目的: 根据目的地的坐标计算自己手机的位置离目的地的距离的 核心思路: 后续操作必须等所有异步请求都返回了才能继续 使用 const qqmap = require("../../utils ...

  8. Linux终端多用户通信实用命令

    一  命令 1.1 write 该命令将当前终端(源)输入的字符拷贝至目标用户的终端,从而发送消息给系统中某个用户.用法如下: #write <user> <msg> [Ctr ...

  9. Writing Reentrant and Thread-Safe Code(译:编写可重入和线程安全的代码)

    Writing Reentrant and Thread-Safe Code 编写可重入和线程安全的代码 (http://www.ualberta.ca/dept/chemeng/AIX-43/sha ...

  10. sql server性能查询,连接数

    1)使用以下查询语句:   select * from sysprocesses where dbid in (select dbid from sysdatabases where name='My ...