Last active
August 29, 2015 14:13
-
-
Save ZachMoreno/76507b9df4dbe0e1866f to your computer and use it in GitHub Desktop.
JS Library Scaffold
This file contains hidden or 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 LibraryName = (function () { | |
var LibraryName = function LibraryName() { | |
} | |
// Todd Moto's forEach method | |
LibraryName.forEach = function forEach(array, callback, scope) { | |
for (var i = 0; i < array.length; i++) { | |
callback.call(scope, i, array[i]); // passes back stuff we need | |
} | |
} | |
// Mozilla's getMaxOfArray method | |
LibraryName.getMaxOfArray = function getMaxOfArray(numArray) { | |
return Math.max.apply(null, numArray); | |
} | |
// Custom method | |
LibraryName.customFunction = function customFunction() { | |
// ... | |
} | |
// http://stackoverflow.com/questions/15174187/properties-of-javascript-function-objects | |
// LibraryName.prototype = { | |
// greet: function () { | |
// console.log('Hello, my name is ' + this.name); | |
// } | |
// }; | |
return LibraryName; | |
})(); | |
jQuery(document).ready(function() { | |
LibraryName.customFunction(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment