1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| let contains = false;
const array = ['imprint', 'data-protection', 'terms-of-use'];
const currentUrl = '/imprint'.toUpperCase();
// mit window.location.href ersetzen
array.forEach(function (item) {
let currentItem = item.toUpperCase();
if (currentUrl.includes(currentItem)) {
contains = true;
}
});
console.log(contains);
|