V. Objects in JavaScript

Source: Internet
Author: User

  Why can object-oriented thinking quickly sweep the world of programming?

Because object -oriented thinking combines data and code into unity for the first time and presents it to programmers with a simple object concept. This all of a sudden, the original chaotic algorithms and subroutines, as well as tangled complex data structures, divided into clear and orderly structure of the object , so as to clarify the data and code in our hearts that group mess-like knot.

In JavaScript, everything can be considered an object for processing.

First, define an object

  

In addition to getting objects directly defined above, you can also use construction methods to get objects.

  

Ii. access to object properties and methods

    1, way one: through the object name. property name, Object name. Method Name ()

2, way two: Through the object name ["Property name"]

    

  Third, JS built-in objects

JS has built-in many objects that can be called directly. such as Array String document and so on. Understand the object-oriented thinking, learn to master these built-in objects, for future programming will bring great convenience.

    

  

V. Objects in JavaScript

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.