Class template JavaScript