I'm currently working on a challenge which involves writing JavaScript players for a board game.

I've also recently discovered private fields in JavaScript (a recent addition), which I thought would be useful to prevent entries from accessing forbidden objects and cheating the game.

The only trouble is that private fields are currently not supported by Firefox (see Mozilla Docs for private fields).

So here are my options:

  • Use the private field and explain on the ticket that the UI version of the game is not usable in Firefox.
  • Remove the private field and describe on the ticket that a certain attribute is out-of-bounds. (I'd also need to manually check answers for it's use).

So what's the right answer in this situation? Restrict the field manually or programmatically?

  • 14
    \$\begingroup\$ As long as you specify it's not allowed to interfere with the controller, people won't. In my opinion, using technical restrictions is mostly unnecessary for this sort of thing. \$\endgroup\$ May 24, 2021 at 18:57
  • 4
    \$\begingroup\$ Either way, I say definitely at least do the latter as submissions don't usually cheat and the former would likely just confuse people who don't know it's cheating. Be explicit, not implicit. \$\endgroup\$
    – Wezl
    May 24, 2021 at 18:57
  • 2
    \$\begingroup\$ IMO, You may but shouldn't. Using some complex syntax will discourage others from posting an answer if they don't familiar with the specified language. That is to say, if you are trying to create a king-of-the-hill challenge, make user focusing on the algorithm / strategy instead of the language would be a better idea. I would suggest that you can duplicate the object with only necessary info and pass it as function argument to user. User may even modify the object but that doesn't matter, since only the return value is used in your controller. \$\endgroup\$
    – tsh
    May 31, 2021 at 8:31

1 Answer 1


Most answers follow the rules and people are happy to leave a comment on ones that don't. So the restriction is unnecessary and the answers should be written clearly enough to easily detect cheating.

Additionally, I don't think it's fair to force Firefox users to use another browser, considering that private fields is only a proposal at this point.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .