Custom Node constants

In Node JS there is a __dirname constant.

Can I define my own constants in the same form?

eg:

__root

or

__myCrazyConstant

Thanks!

You can make a variable with any name you want, no matter how many underscores it contains.

You can create a constant with the const keyword:

const myContsant = 42;
myConstant = 0;
console.log(myConstant); // 42