3 ms·
I usually do something like var Constants = { valueA: function valueA() {}, valueB: function valueB() {} };
by gnud 12y ago
I usually do something like
var Constants = {
valueA: function valueA() {},
valueB: function valueB() {}
};
- Mister_Snuggles 12y agoWhy do you use empty functions instead of a number or a string?
- madeofpalk 12y agoMy guess is than a function will always be a unique object, rather than if it was a number or string, there's a chance you use the same value twice.
- anewhnaccount 12y agoIn ES6 you can use Symbol.