04-04-2023, 07:13 AM
// Check if an array contains a string ignoring upper- or lowercase in JavaScript
const colors = ['Red', 'GREEN', 'Blue'];
const result = colors.map(e => e.toLocaleLowerCase())
.includes('green');
document.write(result);
const colors = ['Red', 'GREEN', 'Blue'];
const result = colors.map(e => e.toLocaleLowerCase())
.includes('green');
document.write(result);
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos