0👍
Looks like you are comparing a string with array. Try this:
// assuming userProfile.accessGroup is an array of strings like ['a', 'c'] etc
// and location.accessGroup is a string: 'a', 'b', 'c', or 'd'
myLocations () {
return this.locations.filter((location) => {
return this.userProfile.accessGroup.indexOf(location.accessGroup) >= 0
})
}
👤gvk
Source:stackexchange.com