Skip to content

Instantly share code, notes, and snippets.

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

  • Save igorparrabastias/87b631ccd0f27c8dbb49 to your computer and use it in GitHub Desktop.

Select an option

Save igorparrabastias/87b631ccd0f27c8dbb49 to your computer and use it in GitHub Desktop.

Revisions

  1. Igor Parra Bastias revised this gist Jun 21, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    // Javi, This is like a bad dog looks like in javascript using class pattern:

    // constructor
    function Dog() {}

  2. Igor Parra Bastias revised this gist Jun 21, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -3,19 +3,19 @@ function Dog() {}

    // class method
    Dog.prototype.seeCat = function() {
    console.log('seeing cat...');
    this.bark('whuf, whuf');
    this.run();
    console.log('seeing cat...');
    this.bark('whuf, whuf');
    this.run();
    }

    // class method
    Dog.prototype.bark = function(bark) {
    console.log(" U°ェ°U " + bark)
    console.log(" U°ェ°U " + bark)
    }

    // class method
    Dog.prototype.run = function() {
    console.log(" ε=ε=ε=ε=ε= U°ェ°U ")
    console.log(" ε=ε=ε=ε=ε= U°ェ°U ")
    }

    // constructor call
  3. Igor Parra Bastias revised this gist Jun 21, 2014. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -3,23 +3,23 @@ function Dog() {}

    // class method
    Dog.prototype.seeCat = function() {
    console.log('seeing cat...');
    this.bark('whuf, whuf');
    this.run();
    console.log('seeing cat...');
    this.bark('whuf, whuf');
    this.run();
    }

    // class method
    Dog.prototype.bark = function(bark) {
    console.log(" U°ェ°U " + bark)
    console.log(" U°ェ°U " + bark)
    }

    // class method
    Dog.prototype.run = function() {
    console.log(" ε=ε=ε=ε=ε= U°ェ°U ")
    console.log(" ε=ε=ε=ε=ε= U°ェ°U ")
    }

    // constructor call
    var dog = new Dog();

    // executing method
    dog.seeCat();
  4. Igor Parra Bastias created this gist Jun 21, 2014.
    25 changes: 25 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    // constructor
    function Dog() {}

    // class method
    Dog.prototype.seeCat = function() {
    console.log('seeing cat...');
    this.bark('whuf, whuf');
    this.run();
    }

    // class method
    Dog.prototype.bark = function(bark) {
    console.log(" U°ェ°U " + bark)
    }

    // class method
    Dog.prototype.run = function() {
    console.log(" ε=ε=ε=ε=ε= U°ェ°U ")
    }

    // constructor call
    var dog = new Dog();

    // executing method
    dog.seeCat();