StefiIOE

2.4

Nov 25th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function curry(func) {
  2.  
  3.   return function curried(...args) {
  4.     if (args.length >= func.length) {
  5.       return func.apply(this, args);
  6.     } else {
  7.       return function(...args2) {
  8.         return curried.apply(this, args.concat(args2));
  9.       }
  10.     }
  11.   };
  12.  
  13. }
  14. function format_date(day, month , year){
  15.     return day + "."+ month + "." + year;
  16. }
  17.  
  18. var date = curry(format_date);
Add Comment
Please, Sign In to add comment