I am working on Reactjs and using nextjs,Right now i am getting "cat_name"(category) inside map function(loop), i just want to add condition "if cat_name!="" || cat_name=="pinned" before fetching data How can i do this,Here is my current code
{students.data?.length > 0 &&
students.data.map((blog) => (
//
{blog.cat_name} // containing category,want to add condition here
if(blog.cat_name)
{
//further code
}
else
{
// further code
}
))}