Closures can integrate just as well with object-oriented code, as well as with procedural code.
闭包可以很好地与面向对象的代码以及面向过程的代码整合。
To reuse object-oriented code, you extract the target code into another class, then use inheritance to access it.
要重用面向对象的代码,您要将目标代码提取(extract)到另一个类中,然后再用继承来访问它。
Objects and closures get along very well, as we saw by the special handling of closures within object-oriented code.
对象与闭包可以很好地结合使用,比如我们在面向对象的代码内对闭包的特殊处理。
应用推荐