Nearata As the title states, the parameter returns undefined code: extend(CommentPost.prototype, 'config', function(isInitialized) { if (isInitialized) return; console.log('abc'); } prints twice Am i missing something?
askvortsov Nearata The first argument to the callback in extend is the output of the method being extended. So you should try for function(res, isInitialized)
clarkwinkelmann Tip: you can console.log(arguments) to see all the arguments that were passed to the method. It's a good way to spot when you're offset from what you expect. This will also show you there's an optional context third argument. (arguments is a special variable that's always available inside of a function and contains an array of all arguments)