You must put your expressions within curly brackets if you want to use. forEach() or other JavaScript methods in JSX. This is required to inform React that everything between curly brackets should be treated as ordinary JavaScript.