Skip to content

Instantly share code, notes, and snippets.

@leolanese
Created October 11, 2016 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leolanese/64de242c73211186875b5fedcd2eb416 to your computer and use it in GitHub Desktop.
Save leolanese/64de242c73211186875b5fedcd2eb416 to your computer and use it in GitHub Desktop.
ES5 Declare Objects as Objects
// ES5 Declare Objects as Objects:
// not that good
var service = {};
service.winJsApp = null;
service.winJSActivation = 1;
service.actions = {
goToView: "goToView",
goToModal:"goToModal"
};
// better
var service2 = {
winJsApp: null,
winJSActivation: 1,
actions : {
goToView: "goToView",
goToModal:"goToModal"
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment