Hate to open a new question for an extension to the previous one:
function ctest() { this.iteration = 0; this.func1 = function() { var result
Your outer function doesn't have a return statement, so it returns undefined.
return
undefined