I tried using this solution but it didn't work for me. In my case I am trying to save a variable using 1 function and call it from another
var postalcode = "code didn't change";
export function save_postal_code(code) {
var localcode = code
let postalcode = localcode;
console.log(code);
}
export function get_postal_code() {
console.log(postalcode);
return postalcode;
}
The save_postal_code function logs the correct value, but the get_postal_code function doesn't. I don't know what I am doing wrong.