Created
October 28, 2015 09:06
-
-
Save carloshanson/da5eb640ba3ceb4693f3 to your computer and use it in GitHub Desktop.
Test to understand basics of underscore.js
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
// 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