Skip to content

Instantly share code, notes, and snippets.

@carloshanson
Created October 28, 2015 09:06
Show Gist options
  • Save carloshanson/da5eb640ba3ceb4693f3 to your computer and use it in GitHub Desktop.
Save carloshanson/da5eb640ba3ceb4693f3 to your computer and use it in GitHub Desktop.
Test to understand basics of underscore.js
// test to understand basics of underscore.js
(function(){
// reference global object as root
var root = this;
// create function object named funky instead of _
var funky = function() { };
// attach function object to global object
root.funky = funky;
// add method to function object
funky.dance = function() {
console.log('Just dance!')
}
// test in console by typing the following:
// funky.dance();
}.call(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment