const arr = ['a', 'b', 'c', 'd', 'e', 'f']; let test = this.dataset.test; if (arr.includes(test)) { // ..... }