js: triangle: make Triangle#kind into a getter

determine triangle kind in the constructor. little weird how the test
expects the Error throw so it's in the exposed method instead of the
constructor.

still don't know if polymorphism in javascript is worth it enough to get
rid of that switch block.