Can a javascript variable be made configurable?
Too vague of a question, bring some examples of code.

It might go in a custom module (thus doing differently) or just using JavaScript where you can surely alter values of a variable.