A
A
Afafks1231321321652020-04-17 11:19:17
JavaScript
Afafks123132132165, 2020-04-17 11:19:17

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

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

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hzzzzl, 2020-04-17
@hzzzzl

declare as a constant

const hu = 'j'

hu = 'ja'
// VM158:3 Uncaught TypeError: Assignment to constant variable.

A
Artur Berdyev, 2020-04-17
@lordgreem

Use classes and validation via get, set

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question