12. jquery source code parsing. EQ (). First (). Last (). Slice ()

Source: Internet
Author: User

EQ (Index): Extracts the elements in the collection that are indexed as index.
First (): Returns an element in the collection.
. Last (): Protect the final element in the collection.
. Slice (Start[,end]): Returns the element of a given interval segment in the collection.
First () and last () call EQ (), EQ () is implemented through slice (), slice () through
. Pushstack () implementation.
Related source

285 line: The usage is peculiar, by a "+" to convert the possible string I to a numeric value.
300~301: First borrow array method slice () get a subset of the specified range from the current jquery object,
Span style= "font-family: italics; font-size:18px; " > in the drop-down method Pushstack () converts a subset to a jquery object, while retaining a reference to the current jquery object through the property prevobject.

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.