1- You want the instance variables in the array..
2- You want to save the array..
3- You want to load the array..
4- You want to set the instance variables from the array after loading..
So why not use 4 always, instead of setting the array values from the instance variables and setting the instance variables from the array values..
Seems to me like doing a job two times..
so on button clicked
set array value
call function "SetInstanceVariablesFromArray"
And
on localstorage item exist
Array load from json localstorage.itemvalue
Cal function "SetInstanceVariablesFromArray"