0

I want to abbreviate this:

data.urlPath !== '#profile' && data.urlPath !== '#communities' && data.urlPath !== '#other'

to something like:

data.urlPath !== '#profile' || '#communities' || '#other'
// this doesn't work

is this possible?

1 Answers1

1

Try this,

['#profile', '#communities','#other'].includes(data.urlPath)

Sanchit Kumar
  • 134
  • 1
  • 5