Curious why the author surrounded object declaration with parenthesis here
rtpg.map.START_KEYS = ({"Key 1":"Value 1", "Key 2":"Value 2", "Key 3":"Value 3", "Key 4":"Value 4"});
why not:
rtpg.map.START_KEYS = {"Key 1":"Value 1", "Key 2":"Value 2", "Key 3":"Value 3", "Key 4":"Value 4"};
There is no functional difference.
In the case that you emplace JSON text in an eval call to obtain a JavaScript object, you have to use parentheses to disambiguate the resulting expression from a statement, but that is not the case here: the object literal follows a = token and can therefore be parsed only as an expression, with no disambiguation required.
The author has therefore done it out of:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With