Here is the code that I am using:
<html> <body> <script language="javascript"> Function.prototype.partial = function(){ var original_function = this; var args1 = [].slice.apply(arguments); return function(){ var args2 = [].slice.call(arguments); return original_function.apply(null, args1.concat(args2)); }; }; function addTwoNumbers(a,b){return a+b;} </script> Partial application #1 </body> </html>
0 comments:
Post a Comment