I'm trying to display a message if only the conditional statements meet a certain requirement but with what I'm getting it fails me. Currently, the script is like this
if ((err.status === 401 && !request.url.includes("users") || !request.url.includes("friends")) ) {
console.log('hello')
}
What I want to achieve is when the status is 401 and the URL doesn't include either users or friends the console should log hello but it fails to work
when I change the code to this
if ((err.status === 401 && !request.url.includes("users")) ) {
console.log('hello')
}
or this
if ((err.status === 401 && !request.url.includes("friends")) ) {
console.log('hello')
}
it works, but I want it to check for both conditions
||to&&if you need to check that url not included 'users' AND not included 'friends'if(err.status==401 && !(request.url.includes("users") || request.url.includes("friends")))