Skip to content

Commit

Permalink
s/pple/ple/g (GoogleChrome#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois authored and jeffposnick committed Aug 1, 2016
1 parent 9e1dde9 commit 75f95f7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions classes-es6/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,28 @@ r.sayName();

// Classes support static members which can be accessed without an
// instance being present.
class Tripple {
class Triple {
// Using the 'static' keyword creates a method which is associated
// with a class, but not with an instance of the class.
static tripple(n) {
static triple(n) {
n = n || 1;
return n * 3;
}
}

// super.prop in this example is used for accessing super-properties from
// a parent class. This works fine in static methods too:
class BiggerTripple extends Tripple {
static tripple(n) {
return super.tripple(n) * super.tripple(n);
class BiggerTriple extends Triple {
static triple(n) {
return super.triple(n) * super.triple(n);
}
}

ChromeSamples.log(Tripple.tripple());
ChromeSamples.log(Tripple.tripple(6));
ChromeSamples.log(BiggerTripple.tripple(3));
// var tp = new Tripple();
// ChromeSamples.log(tp.tripple()); tp.tripple is not a function
ChromeSamples.log(Triple.triple());
ChromeSamples.log(Triple.triple(6));
ChromeSamples.log(BiggerTriple.triple(3));
// var tp = new Triple();
// ChromeSamples.log(tp.triple()); tp.triple is not a function

// Example 6: Subclassing built-in classes and DOM
// ===============================================================
Expand Down

0 comments on commit 75f95f7

Please sign in to comment.