Skip to content

Instantly share code, notes, and snippets.

@uri-chandler
Created March 2, 2016 19:01
Show Gist options
  • Save uri-chandler/167ce96017e661373a71 to your computer and use it in GitHub Desktop.
Save uri-chandler/167ce96017e661373a71 to your computer and use it in GitHub Desktop.
[Loose Coupling Is A Lie] Code Listing 2
/**
* Example of loose coupling between work() and shovel.use()
*/
function work(tool){
tool.use();
}
var shovel = {
use: function(){ console.log("Every day I'm shoveling...umph umph") }
};
work(shovel);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment