July 2008
Beginner
356 pages
6h 8m
English
shape that has a type property and a getType() method. Triangle() constructor function whose prototype is shape. Objects created with
() should have three own properties—a, b, c representing the sides of a triangle.getPerimeter().>>> var t = new Triangle(1, 2, 3); >>> t.constructor
Triangle(a, b, c)
>>> shape.isPrototypeOf(t)
true
>>> t.getPerimeter()
6
>>> t.getType()
"triangle"
t showing only own properties and methods (none of the prototype's).>>> [1,2,3,4,5,6,7,8,9].shuffle()
[2, 4, 1, 8, 9, 6, 5, 3, 7]
Read now
Unlock full access