returns function:
function func(_func) { this._func = _func; return function() { alert("called a function"); this._func(); } } var test = new func(function() {
but then this refers to the function being returned (right?) or window, you have to cache this to access it from inside the function ( this._func(); )
function func(_func) { var that = this; this._func = _func; return function() { alert("called a function"); that._func(); } }
andlrc
source share