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);