Javacript advanced Programming-advanced techniques

Source: Internet
Author: User
1. Advanced Techniques 1.1 functions

L can defer any branch to the first calling function using the lazy load function

The L function binding allows you to create functions that are always run in the specified environment, while the function curry allows you to create functions that have already filled in certain parameters.

L Combine binding and curry to execute functions with arbitrary parameters in any environment

1.2 Objects

ECMASCRIPT5 allows you to create tamper-resistant objects in several ways:

L Non-extensible objects, not allowed to add new properties or methods to objects

L sealed objects, also non-extensible objects, do not allow the deletion of existing properties and methods

L Freeze objects, also sealed objects, do not allow members of re-objects

1.3 Timers

The L Timer code is placed in a waiting area until the event interval is reached, adding code to the processing queue of the JavaScript, waiting for the next JavaScript process to run idle

Every time a piece of code executes, there will be a small amount of free time for other browsers to process

This behavior means that you can use a timer to slice a long-running script into a small piece of code that can be run at a later time, helping the Web app to have a more positive impact on user interaction

Javacript advanced Programming-advanced techniques

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.