-
-
Save zegomesjf/5876204 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;var FooBar = (function($, window, document, undefined) { | |
'use strict'; | |
/** | |
* Constructor method | |
* | |
* @author Gustavo Franco | |
* @since 2013-06-27 | |
*/ | |
function FooBar() { | |
try { | |
console.log('constructor'); | |
} catch (exception) { | |
console.error(exception); | |
} | |
} | |
/** | |
* Foo method | |
* | |
* @author Gustavo Franco | |
* @since 2013-06-27 | |
*/ | |
FooBar.prototype.foo = function() { | |
try { | |
console.log('foo'); | |
} catch (exception) { | |
console.error(exception); | |
} | |
}; | |
/** | |
* Bar method | |
* | |
* @author Gustavo Franco | |
* @since 2013-06-27 | |
*/ | |
FooBar.prototype.bar = function() { | |
try { | |
console.log('bar'); | |
} catch (exception) { | |
console.error(exception); | |
} | |
}; | |
return FooBar; | |
})(jQuery, window, document); | |
var fooBar = new FooBar(); // constructor | |
fooBar.foo(); // foo | |
fooBar.bar(); // bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment