I am working on a simple library in javascript. I use one design function that wraps all this. I have private and public properties and functions.
function myContructor(options){
this.canvas = options.canvasOptions;
var taht = this;
function _createCanvas() {
var width = that.canvas.width;
}
function _createCanvas(width) {
var width = width;
}
this.run = function() {
_createCanvas();
_createCanvas(that.canvas.width);
}
}
Question: when I call a function (public or private), should I pass arguments to it or just let the function access public properties through the that.myPublicPropertyfunction inside and call it without arguments? How do you do it and why?
source
share