Code samples for Javascript classes