i cant retrieve a value from local Storage and perform arithmetic on it. it comes up as NaN
I'm sending several values to Local storage via "set storage variable" action using "bind to component" to a label's text element.
but then i try to retrieve from local storage and i cant because it cant parseInt().
when i look at the debug tools, i see something like " "0" " when the variable is a number, but if it is text, it doesnt have qoutation marks.
in the image below, when i click the checkmark ( black ink) i send the number of available invitations ( blue ink) and the number of used invitations (red ink) to local storage.
immediately after i try something similar to
var invitations=parseInt( localStorage.getItem('invitations_lsv') );
var used=parseInt( localStorage.getItem('used_lsv') );
if ( invitations used ) then used++; //this is a check-in
i can never compare as i always get a NaN
why??