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

How can prevent user for modify value of variables?
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);