0👍
✅
Since you are referencing the component data inside a nested function, you need to keep a scoped reference to the object.
function () {
var self = this;
var account = JSON.parse(localStorage.getItem('userdetails')).find(function(userdetails) {
return (self.email === userdetails.email && self.password === userdetails.password) ? userdetails : null;
});
Source:stackexchange.com