JS design mode---Reading notes 001--expressive JS

Source: Internet
Author: User

JS Weak type:

Raw data types are transferred by value, and other data types are routed by reference

Variables can vary type based on assigned value, type conversion between primitive types (toString (), parseint (), parsefloat (), double ' non ' transition to Boolean value )

Http://i.cnblogs.com/EditPosts.aspx?opt=1

Function:

Anonymous functions are used to create closures (a protected variable space, generated by inline functions).

Function-level scope--function internal variables are not accessed externally

The word hair nature of a scope---function runs at the scope that defines it, not the scope that calls it

Object:

Variability----can modify objects

Introspection-----can examine the properties and methods of an object at run time, which can be used to dynamically instantiate a class and execute its methods (called reflection)

JS anything can be modified in the run.

Inheritance (two types of methods):

Object-based (prototype) inheritance

Imitating class-based inheritance

It's easy to implement design patterns, and knowing when to use what patterns is the key

    

JS design mode---Reading notes 001--expressive JS

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.