function(it){ return true or false; }All the models constituting eXERD documents are passed as the parameter of the closure ¡®it¡¯, and if the closure returns true, that model is selected. For example, below is the method to select all the columns :
select(function(it){ return it.get("type") == "column"; })As a result of the above code, every model whose property is "column" is selected. Here, the models selected by using "select(conditional function())" are called "model context".
It is okay to use other variable names.
select(function(it){ return it.get("type") == "column"; }).each(function(it){ log(it.get("logical-name")); });
The function "each(closure)"
lets all the elements that belongs
to a model context perform the given closure behavior in terns. (It
is helpful for understanding to remind the Visitor Pattern.)