Iterator
What is an iterator?
Iterator is one such mechanism. It is an interface that provides a unified access mechanism for various data structures. As long as any data structure deploys the Iterator interface, it can complete the traversal operation (that is, process all members of the data structure in sequence).
There are three functions of Iterator: one is to provide a unified and convenient access interface for various data structures; the other is to enable the members of the data structure to be arranged in a certain order; the third is that ES6 creates a new traversal command “for… of” loop, Iterator interface is mainly for “for… of” consumption.
An iterator is a special object with a next () method that returns a result object every time next () is called. This object has two Attributes - Value Pair, value and done, value is the result returned by the iterator each time, and done marks whether the iterator has ended. We can simulate an iterator using es5 syntax.
codereview
During the few days when everyone was happy, Google released two docs, which I feel is very necessary to know as a programmer and engineer. After reading, the author intercepted some of the original text and simplified some other parts to summarize.
Pay attention to sharing variables when Node processes in parallel
I encountered a strange bug at work this week. After searching for a long time, I found that it was the reason why a shared object variable was tampered with during parallel computing
Introduction to blockchain
Blockchain is a big hit right now, with a lot of news media coverage claiming that it will create the future.
After reading some papers, blogs and official docs, the author integrated the content of these materials with his own understanding and reorganized them.
MongoDB Tutorails
After reading the official mongoDb documentation, the author sorted out the basic concepts, CRUD, and related operations
ARP virus principle and defense
ARP virus principle and defense and how to quickly locate the source of ARP virus.
CommonJs,Requirejs和ES6
Use of CommonJs, Requirejs and ES6 modules.
http-proxy-middleware
When the front end communicates with the background and encounters cross-domain problems, we can solve the cross-domain problem by setting up an nginx proxy to modify the source of the request. However, in fact, we can also set up a proxy ourselves through the http-proxy-middleware of nodejs.
Vue Mix
Mixins provide a very flexible way to distribute reusable functionality in Vue components. A mixin object can contain arbitrary component options. When a component uses a mixin object, all options for the mixin object will be “mixed” into the options of the component itself.