I'm working with express, ejs and mongoose . i have list of products in mongoDB and i want to display images of products which is store in my local storage. i used express.static method to access images. my images named like this SAMSUNG Galaxy M33 5G (Emarld Brown, 128 GB) (6 GB RAM) , i saved their name in an array ( like object ) called category. my code is following
<% for( list of category){ %>
<ul>
<img src="/<%=list.name%>.jpeg" alt="<%=list.name %>">
<li><%= list.name %> </li>
</ul>
<% } %>
in this case no image is displayed but when i removed brackets () from the name of image ( like this SAMSUNG Galaxy M33 5G Emarld Brown, 128 GB 6 GB RAM ) it start working like wonder but i have so many images and i cant change name of all images please help me to solve this problem