I have 50 elements in a javascript array .
For 20 elements in the above javascript array , i need to do some manipulation while displaying them within for loop(adding class style dynamically)
This is my code
var stocks=['ABAN','ADANIENT','ADVANTA']; // i have 50 elemnts in array
for(var i=0;i<stocks.length;i++)
{
var stockname = stocks[i];
if(stockname=='ABAN' || stockname=='ADANIENT') // do i need to write 20 elements inside the for loop
{
console.log('print');
}
else
{
}
}
$.inArray()or something to check in the if statement.