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