Skip to content

Instantly share code, notes, and snippets.

@psaitu
Created August 18, 2014 11:56
Show Gist options
  • Select an option

  • Save psaitu/25072df64eb25cac32e8 to your computer and use it in GitHub Desktop.

Select an option

Save psaitu/25072df64eb25cac32e8 to your computer and use it in GitHub Desktop.
function Post(options) {
this.title = options.title || "A New Post";
this.author = options.author || "Anonymous";
this.blob = options.blob || "This post is emply...";
}
var MyApp = {}
post_options = {
title: "A Beautiful Day",
author: "Author Name",
blob: "Today was a beautiful day that was productive and fun..."
}
MyApp.post = new Post(post_options);
delete MyApp.post;
console.log(MyApp.post.blob);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment