Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

278
Visualizações
How to prevent user for manipulate / change value of variable in browser?

Someone change variable value of their data in my website.
Next step this variable value pass to server from api call.

It change value in chrome browser by following steps.
Open chrome -> Inspect Element -> Source -> Scope

I was put all validation like, user can not open inspect element from using of any shortcut keys.

Following is sample code and my situation enter image description here

How can prevent user for modify value of variables?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You've should use const keyword. It similar to let keyword but not the same.

By declaring with const keyword it's value can only be Read by user and cannot be modified. It does not allow to change it's value to change through reassignment and it cannot be redeclared.

If you declare data types with const keyword object and arrays, it's properties or items can be updated or removed.

if you try to reassign the constant variable it will throw an error.

let num1 = 1;
const num2 = 1;

console.log(num1);
num1 = 2;
console.log(num1);

console.log(num2);
num2 = 2;
console.log(num2);

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda