Skip to content

Instantly share code, notes, and snippets.

@Cfeusier
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save Cfeusier/ff700bfdaf6f4651b05d to your computer and use it in GitHub Desktop.

Select an option

Save Cfeusier/ff700bfdaf6f4651b05d to your computer and use it in GitHub Desktop.
Example of the Functional 'Class' Pattern in JavaScript
var Example = function() {
var example = {};
var extraState = "Example Property Value";
example.exampleGet = function() {
return extraState;
};
example.exampleSet = function(value) {
extraState = value;
};
return example;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment