

Over.js - Elegant function overloading in JavaScript - matryer
https://github.com/stretchr/over.js
over.js formalizes the way we write overloaded functions, so there&#x27;s no more chunky switch cases and argument.length checks inside every function.  What do you guys think?
======
matryer
var obj = {

    
    
      /**
       * Says something in the console.
       *
       * say(msg) - Says something once.
       * say(msg, times) - Says something many times.
       */
      say: Over(
        function(msg$string){
          console.info(msg$string);
        },
        function(msg$string, times$number){
          for (var i = 0; i < times$number; i++) this.say(msg$string);
        }
      )
    

};

------
stigoalie31
Very clever!

