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
I was trying to rewrite the "extend" function by introducing more combinators and make it look better. Please do comment on this.
// This function should be renamed ... Any suggestions ??functionobjMapWith(fn){returnfunction(obj){Object.keys(obj).forEach(function(key){fn(key,obj[key]);});};}// This is not pure function but might be the required one.// Comments ?? functionaddPropTo(obj){returnfunction(key,val){returnobj[key]=val;}}extend=variadic(function(consumer,providers){mapWith(objMapWith(addPropTo(consumer)))(providers);returnconsumer;});
The text was updated successfully, but these errors were encountered:
I was trying to rewrite the "extend" function by introducing more combinators and make it look better. Please do comment on this.
The text was updated successfully, but these errors were encountered: