Cómo agregar clase en JavaScript dinámicamente

<h1 class={isLoggedin ? "active" : "disabled"}>HELLO WORLD</h1>
Runtime Terror