Hello, I am facing a dilemma. I need to apply category filtering to a JSON file but I am unsure of how to proceed with it. For instance, I wish to filter the 'vida' category along with its description and price.
I seem to be stuck at this juncture in my assignment and cannot figure out how to make progress.
If there is any online resource or link that can provide answers to these questions, I would greatly appreciate it.
<div class="container">
<div class="row">
<ul>
<% productsData.forEach(function (product) { %>
<li>
<br>
<div class="col-sm-12 col-md-12 col-lg-12 prdDet">
<div class="col-sm-4 col-md-4 imgcart">
<img src="../images/prdImages/<%= product.prd_image %>" style="width: 200px;height: 200px;">
</div>
<br>
<div class="col-sm-8 col-md-8">
<b>Categoria:</b> <%= product.prd_category %> <br>
<b>Descripcion:</b> <%= product.prd_description %> <br>
<b>Precio:</b> $<%= product.prd_price %> <br>
<br>
<br>
</div>
</div>
</li>
<% }) %>
</ul>
</div>
</div>
[
{
"id": 5,
"prd_category": "VIDA",
"prd_description": "Content will not be repeated here.",
"prd_price": 1202,
"prd_image": "1579108895351.jpg"
},
{
"id": 8,
"prd_category": "VIDA",
"prd_description": "Duplicate content will not be displayed again.",
"prd_price": 2038,
"prd_image": "1579108921234.jpg"
}
// Remaining data entries for VIDA category excluded for brevity