Recommended JS Library: Underscore

Source: Internet
Author: User

The underscore encapsulates common JavaScript Object manipulation methods for improved development efficiency.

Between the useless he wrote before, and that was quite sour.

such as cyclic processing:

for (var i=0;i<data.length;i++) {    //TODO    }

With his

_.each (data,function(item) {    //TODO})

To delete a piece of data

data = _.reject (data,function(item) {    return item.id =   ID to delete})     

Still have many, need oneself to experience, use all know very hign

Attached API, daily can also view the next

In English: http://underscorejs.org/

Domestic translation: Http://www.css88.com/doc/underscore/

-------------

PS: The official website of the left has a filter search, very good, good thinking, you can also view the source code

Effect:

Query map

And look at the realization of his main.js.

The implementation of the idea is as follows:

1. Listen to the above input box, if there is a change, call 1 methods

2. In the method, get the element on the left-hand side of the list, and figure out what to hide.

----------------------------------------------------

Here is a brief introduction, not to move the content, you can go to see

--------------------------------

Underscore.js Getting Started http://www.css88.com/archives/4728

Underscore.js Getting Started-Introduction to common methods http://www.css88.com/archives/4784

Recommended JS Library: Underscore

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.