If you're after idiomatic javascript, you should set these constants below the definition of the Demo function, not inside it. Like this, the constants can't be used until at least one demo object has been created.