Attribute and subscript

Source: Internet
Author: User

1. Storage attributes are divided into constant attributes (let) and variable attributes (VAR)

2, using lazy definition delay load, as the name implies in the first access will be loaded, if not access, never back to create, so reduce memory consumption.

3. The attribute watcher Willset called Didset after the new value is set before setting a new value.

4, calculate the property, provide getter (accessor) setter (set accessor)

5 static property.

6, arrays and dictionaries can be accessed using subscript, for example: Var status:string[]=["1", "2", "2"] status[0]= "2"

Attribute and subscript

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.