1.1js Language Core

Source: Internet
Author: User

A: Object: An object is a collection of name/value pairs, or a mapping of string-to-value pairs.

1.1 objects are enclosed in curly braces and contain attributes and values;

Eg:var book = {name: ' Zhang ', Age: ' 22 '};

1.2 Accessing Object Properties

A, Book.name//zhang

B, book["name"]//zhang

C, Book.author = "Joy"; Create a new property by assigning a value

D, book.content = {}; Create a new object

1.3 Array Objects

var arry = [1,2,3,4];

Arry.length//4

Arry[0]//1

ARRY[4] = 5; Assigning a value to index 4

ARRY[4] = 6; Change the value of index 4 to 6

1.4 An Array object can contain another set of array objects

var pointer = [

{A: ' ASD ', B: ' Asdas '},

{c: ' Dsadas ', d:123}

];

The object contains an array.

var data = {

data1:[[1,2],[3,4]],

data2:[[5,6],[7,8]]

};

1.1js Language Core

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.