Echo JS 0.11.0

<~>
orebla1 2675 days ago. link 4 points
I am totally confused by the article.
I use factory functions all the time and they are as old as JavaScript.
Definitely nothing to with ES6+ 
Instead they benefit from the closure concept

function createTimer() {
   var count = 0;
   return {
      inc : function() { count++; },
      getCount : function() { return count; }, 
      reset :    function() { count = 0; } 
   };
}

Replies

iwouldloveto 2675 days ago. link 1 point
thumbs up.
your factory function is clear and who needs classes