How to make js variables which cannot be changed through the console?

How to make js variables which cannot be changed through the console?
April 19th 20 at 12:29
2 answers
April 19th 20 at 12:31
declared as a constant

const hu = 'j'

hu = 'ja'
// VM158:3 Uncaught TypeError: Assignment to constant variable.
and I can then myself to change it? - Danika.Raynor67 commented on April 19th 20 at 12:34
@Danika.Raynor67, no, but otherwise from the user, you can "hide" only variable which is declared inside of a function, in General, better code view - gladyce80 commented on April 19th 20 at 12:37
@gladyce80, there is no Code here I want the game to be done online.With ajax understand now need to allow the player to cheat yourself everyone. - Danika.Raynor67 commented on April 19th 20 at 12:40
@Danika.Raynor67, it makes no sense to hide the variables so as always, you can send a request to the server and independently... And in General, the client cannot be trusted) - Archibald_Lynch commented on April 19th 20 at 12:43
@Archibald_Lynchis if growing wheat every second to test it? - Danika.Raynor67 commented on April 19th 20 at 12:46
@Archibald_Lynch, I would Like to ajax - Danika.Raynor67 commented on April 19th 20 at 12:49
@Danika.Raynor67, web sockets, you can try to use. - Archibald_Lynch commented on April 19th 20 at 12:52
@Archibald_Lynch, Well, this server needs ,and I like it there. - Danika.Raynor67 commented on April 19th 20 at 12:55
@Danika.Raynor67, but AJAX requests, too, because going somewhere.. to the server) - Archibald_Lynch commented on April 19th 20 at 12:58
@Danika.Raynor67and Axy where to send, if not on the server?
times per second something cecati on the server is quite often, but I would generally advise about it yet not think, and start writing the game, passing well-done - gladyce80 commented on April 19th 20 at 13:01
@gladyce80, once I did so, now make the game clearly knowing the main points. - Danika.Raynor67 commented on April 19th 20 at 13:04
@Archibald_Lynch, For websockets you need a server.And ajax sends requests to that script on the hosting. - Danika.Raynor67 commented on April 19th 20 at 13:07
April 19th 20 at 12:33
To use the classes and validation using the get, set

Find more questions by tags JavaScript