How to have the definitions in one place in javascript

How to have the definitions in one place in javascript
0.0 0

#1

Hey everybody
My question is not exactly about cocos2d, its more about the techniques of coding. I have some experience with cocos2d-x and C++ programming, usually I create a .h file named constants.h and I put my constants in it. For example:
const int enemySpeed = 2; const int playerSpeed = 6;
and so on.
But I don’t know how to do something like this in java script. Is there a way to create a separate js file and put the constants in it? If its possible to do so, please be specific because I’m new to java script.