A pot
Rosemary
A pot
AppleGalaMust696
A pot
Primrose
A pot
EchinaceaSunrise
A pot
Rose
12345
let garden = [
	"Rosemary", "Apple 'Gala Must 696'", 
	"Primrose", "Echinacea 'Sunrise'", 
	"Rose"
];
123456
for  (const plant of garden) {
if (plant.match(//i) {
water(plant);
}
}
Lesson 15 / 42

Lesson task •

Water plants which names end with non-word character

Any single non-word character

\W

Matches single character, that is not letter, number or underscore
123456
console.log(!!"foo$".match(/foo\W/)) // true 
console.log(!!"foo*".match(/foo\W/)) // true 
console.log(!!"foo_".match(/foo\W/)) // false 
console.log(!!"foobar".match(/foo\W/)) // false 
console.log(!!"foo42".match(/foo\W/)) // false 
console.log(!!"foo".match(/foo\W/)) // false