Javascript learning notes (2) array and object section _ basic knowledge

Source: Internet
Author: User
This article is the second part of the study notes series. It briefly introduces the related knowledge from the javascript Object and array parts, and attaches a detailed example, which is very practical, for more information, see Javascript Object Section

I. Basics

1. All variables in JavaScript are objects, except for null and undefined.

2. Jscript supports four types of objects: internal objects, generated objects, and objects provided by the host (all BOM and DOM objects are host objects .) And ActiveX objects (external components ).

3. Microsoft Jscript provides 11 internal (or "built-in") objects. They are Array, Boolean, Date, Function, Global, Math, Number, Object, RegExp, Error, and String objects.

4. The object is only a special type of data. The object has attributes and methods. JavaScript is an object-oriented language, but JavaScript does not use classes. JavaScript is based on prototype rather than class.

5. attribute: a variable that belongs to a specific object. Method: it is a function that can only be called by a specific object.

6. A Jscript object is a set of attributes and methods. A method is a function that is a member of an object. An attribute is a value or a group of values (in the form of an array or object) and a member of an object.

7. javascript objects are based on constructors. When using constructors to create a new object, it can be said that a new object is instantiated. Attribute is the variable inside the constructor function.

Objects instantiated using constructors:

Cat = new Animal ();
8. Javascript is an object-based language. Almost everything you encounter is an object. However, it is not a real Object-Oriented Programming (OOP) language, because its syntax does not contain class ).

The Code is as follows:


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.