I used prototypes to implement the Shape "class", and Triangle; Square; and Pentagon "subclasses". The instanceof operator should behave properly when used on instances of any of the three classes.