I have a JavaScript file with an Object inside. What I'm trying to do is change the Object variable values using another JavaScript file. However if i change the values and close and reopen the JavaScript file with an Object inside, the values revert back to its original value.
Is there any way to change the Object values and save them, so when i close and reopen the file it has the new values instead of the old ones.
JavaScript file with an Object:
var datax = {
Temperature: 20,
Light_Intensity: 40,
button: 0,
max1: 0,
Counter: 0
};
A second JavaScript file that changes datax Object values:
//Temperature
max = max / 655.34;
max = Math.round(max);
datax.max1 = max; //Changes the datax object max1 value
$('#temp').html(datax["max1"] + "°C");
1)Cookies2)on your server3)local storage