Possible Duplicate:
Are there constants in Javascript?
For example here I set the close time on this menu to 1 second or 1000 milliseconds.
menu.menu_timer=window.setTimeout(menu.hide_menu, 1000);
Does javascript have a const like C or a Define like PHP to define Constants?
Update 2017
ES6, or ECMAScript2017, comes with the support for constants using the keyword
const.While some use camelCase syntax for the constant’s names, it still is perfectly valid to use the capitalized (snake_case) version (e.g.
const VARIABLE_NAME;)Original answer
JavaScript does not have constants.
You could use the convention of all uppercase for constants.
or you could wrap it in an object.