When I try to run the function below upon mounted, I encounter an error:
"Cannot set the property 'days' of undefined"
Here is my code snippet:
function getDays(date) {
this.days = (new Date()).getTime() / (1000 * 24 * 60 * 60);
return parseInt(this.days) - this.START_DAYS;
}
I find it unhelpful that the error message doesn't specify the line causing the issue. My use of `this.days` instead of `let days` was due to a problem with VueJS.
Since I am still learning about VueJS and how it handles variables, any insights are appreciated.