I have a user object as below and an array of location ids. I don't want the user.location_id to be equal to any value in the location_ids array stated as below using Javascript. Please help me achieve it.
user: {
first_name: 'James',
last_name: 'Smith',
location_id: 21
},
location_ids:[23, 31, 16, 11]
So I want to
if (user.location_id != any value in the locations_ids array) {
console.log("Select User")
}
Help me achieve this using javascript
if (!location_ids.includes(user.location_id)) { console.log("Select user"); }