Skip to content

Instantly share code, notes, and snippets.

@brookemckim
Last active December 12, 2015 08:58
Show Gist options
  • Save brookemckim/4747436 to your computer and use it in GitHub Desktop.
Save brookemckim/4747436 to your computer and use it in GitHub Desktop.
(function() {
var Drop = window.Drop = function() {
var files = [];
var add = function(word) {
files.push(word);
return files;
}
return {
files: files,
add: add
}
}
})()
// All of these seem to be the same?
var a = Drop();
var b = new Drop();
var c = new Drop;
// Each has their own state which is what I want.
a.add("file1");
b.add("file2");
c.add("file3");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment