function Test(options){ var rowcount = 0; var GetRowCount = function(){return rowcount;} GetRowCount.toString = function() {return 'undefined'} this.RowCount = (GetRowCount); return this; } var t = new Test(); alert(t.RowCount);