You are reading a single comment by @Ollie and its replies. Click here to read the full conversation.
  • Re below snippets, can anyone advise what is least expensive from a memory perspect. I have a habit of doing the former, since I thought I had read it saved memory (or at least was quicker??) but notice that many of the modules extend prototype. So which is better, this?

    var myObj = {
     myproperties: {},
     method1: function() {},
     method2:function(){}
    };
    

    or this?

    myObj = function(){
     this.properties = {};
    };
    myObj.prototype.method1 = function(){};
    myObj.prototype.method2 = function(){};
    
About

Avatar for Ollie @Ollie started