Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
ES6 Classes
node v4.9.1
version:
1.0.0
endpoint
share
tweet
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…
23 comments
posted
2 years ago
by
5a25a1f84876460012539b35
iza's asshole is gaping wide when he went to prison
posted
2 years ago
by
5a25a1f84876460012539b35
there gonna send him back for some more
posted
2 years ago
by
5a25a1f84876460012539b35
duck duck goose
posted
2 years ago
by
5a25a1f84876460012539b35
FUCKING NIGGER
posted
2 years ago
by
5a25a1f84876460012539b35
ay fuck you cuz \\
posted
2 years ago
by
5a25a1f84876460012539b35
IMMA KILL YA FAMILY
posted
2 years ago
by
5a25a1f84876460012539b35
do it bitch try to kill iza's family
posted
2 years ago
by
5a25a1f84876460012539b35
he lives in covina CA
posted
2 years ago
by
5a25a1f84876460012539b35
im coming for ya nigga
posted
2 years ago
by
5a25a1f84876460012539b35
IZA IM GONNA RAPE YOU CYLAT BLYAT
posted
2 years ago
by
5a25a1f84876460012539b35
IZA IM RAPE YOUR FAMILY CLYCA BLYT
posted
2 years ago
by
5a25a1f84876460012539b35
i live in the USA covina california
posted
2 years ago
by
5a25a1f84876460012539b35
area code 91706
posted
2 years 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
2 years ago
by
lavonda15
Life is like the wind you never know what direction it's going to blow you in...QLl
posted
a year ago
by
tamu18115
automobileservices.org
posted
a year ago
by
quangthong81
Follow
posted
a year ago
by
5b8c17e413b6a400127dafeb
Were is my car or do I need to go get one
posted
a year ago
by
warbee
why am I having this o n my work flo?
posted
9 months ago
by
ekkarat
How do it.?
posted
8 months ago
by
865363729
15759016569
posted
3 months ago
by
carmella
any p;ost from 1993?
posted
2 months ago
by
abhishektech
huhh...
sign in
to comment