Basically I have a function that reads cookies. getCookie('message').
When getCookie('message') value changes I want to display an alert with the new value.
I think the function can be treated as a variable. Thus the question's title if not please let me know so I correct it. How can I listen for a change in the value the function returns?