You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partial application is great and can be applied to constructors as well. For example:
functionMyWidget(name,options){// ..}MyWidget.prototype.get=function(){/*..*/};varMyWidgetWithCoolOpts=_.partial(MyWidget,_,{/*some options*/});varwidget=newMyWidgetWithCoolOpts('foo');widgetinstanceofMyWidget// truetypeofwidget.get// function
However, currently Underscore does not support this. It could if it shared a bit of the bind helper code to do the instanceof check.
The text was updated successfully, but these errors were encountered:
Partial application is great and can be applied to constructors as well. For example:
However, currently Underscore does not support this. It could if it shared a bit of the bind helper code to do the
instanceof
check.The text was updated successfully, but these errors were encountered: