Skip to content

Instantly share code, notes, and snippets.

@iegorov
Created October 30, 2013 10:14
Show Gist options
  • Save iegorov/7230158 to your computer and use it in GitHub Desktop.
Save iegorov/7230158 to your computer and use it in GitHub Desktop.

Revisions

  1. iegorov renamed this gist Oct 30, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. iegorov created this gist Oct 30, 2013.
    24 changes: 24 additions & 0 deletions new_gist_file.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    function Article() {
    this.tags = ['js', 'css'];
    }

    Article.prototype.printTagsList = function() {
    console.log( this.tags.join(', '));
    };

    var article = new Article();

    function BlogPost() {}

    BlogPost.prototype = article;

    var blog = new BlogPost();

    function StaticPage() {
    Article.call(this);
    }

    var page = new StaticPage();

    blog.printTagsList();
    page.printTagsList();