Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

273
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda