Exploring the mysteries of "point" grammar

Source: Internet
Author: User

Dot syntax

All along, you don't understand what a point syntax is, it's the equivalent of a link or a path. Maybe I browsed less information, read a few related blog posts, there is no record, this is only a preliminary analysis of insights.

In JavaScript, properties and methods are accessed using the "dot" syntax:

Object.property accesses data in an object by means of a     property Object.Method ()      accesses the data in the object through the form of a method

So, ". Dot is the operator of the Access object property, method in JS.

According to this period of time after learning JSON observation found: Point syntax operation, first "." Have to be an object.

JSON first converted to JSON object

Oh! Yes, there are arrays, which are converted to array objects.

var Lennon = Array ();  or var Lennon = Object ();   < recommended Use >lennon.name = "Xiaoyaochaoer"; lennon.age = 23;

PS: All variables in JavaScript are actually objects of some kind.

Exploring the mysteries of "point" grammar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.