ES6 Classes

node v4.9.1
version: 1.0.0
endpointsharetweet
Classes are a shorthand that make it easier to work with JavaScript's existin prototypal inheritance.
class Shape { constructor(sides) { this._sides = sides; } get sides() { return this._sides; } }
class Triangle extends Shape { constructor(...angles) { super(3) this._angles = angles; if (angles.length !== 3 || angles[0] + angles[1] + angles[2] !== 180) throw RangeError("Triangles must have 3 sides at angles equaling 180"); } get angles() { return this._angles; } }
(new Triangle(90,45,45)).sides
Loading…

15 comments

  • posted 6 months ago by 5a25a1f84876460012539b35
    iza's asshole is gaping wide when he went to prison
  • posted 6 months ago by 5a25a1f84876460012539b35
    there gonna send him back for some more
  • posted 6 months ago by 5a25a1f84876460012539b35
    duck duck goose
  • posted 6 months ago by 5a25a1f84876460012539b35
    FUCKING NIGGER
  • posted 6 months ago by 5a25a1f84876460012539b35
    ay fuck you cuz \\
  • posted 6 months ago by 5a25a1f84876460012539b35
    IMMA KILL YA FAMILY
  • posted 6 months ago by 5a25a1f84876460012539b35
    do it bitch try to kill iza's family
  • posted 6 months ago by 5a25a1f84876460012539b35
    he lives in covina CA
  • posted 6 months ago by 5a25a1f84876460012539b35
    im coming for ya nigga
  • posted 6 months ago by 5a25a1f84876460012539b35
    IZA IM GONNA RAPE YOU CYLAT BLYAT
  • posted 6 months ago by 5a25a1f84876460012539b35
    IZA IM RAPE YOUR FAMILY CLYCA BLYT
  • posted 6 months ago by 5a25a1f84876460012539b35
    i live in the USA covina california
  • posted 6 months ago by 5a25a1f84876460012539b35
    area code 91706
  • posted 5 months ago by dirtydeeds25
    YOU SOUND LIKE A BUNCH IGNORANT ASSHOLES ACTUALLY YOU WOULD HAVE TO MARK AN " X " YOU BOTH LOOK LIKE ALL ASSHOLES TO ME
  • posted 3 months ago by lavonda15
    Life is like the wind you never know what direction it's going to blow you in...QLl

sign in to comment