I have the following code:
// ARREGLO
producto = [
{ n: 'Jabon en Pasta', az: 1, ro: 0, am: 0, bla: 0, c: ' ', v: 0, t: 'sol', grupo: 'No Incluidas' },
{ n: 'Ambientador', az: 2, ro: 1, am: 0, bla: 0, c: ' ', v: 0, t: 'liq', grupo: 'Incluidas' },
{ n: 'Cloro', az: 2, ro: 0, am: 1, bla: 0, c: ' ', v: 0, t: 'liq', grupo: 'No Incluidas' },
{ n: 'Desinfectante', az: 2, ro: 1, am: 0, bla: 0, c: ' ', v: 0, t: 'liq', grupo: 'Incluidas' } ];
I want to obtain a separate listing of group products included and not included I've tried something like:
ncompoa = "<h1>Formulas Incluidas</h1><ol>";
for (li in producto) {
ncompoa += "<li>";
if (producto.grupo = 'Incluidas') {
ncompoa += producto[li].n;
}
ncompoa += "</li>";
};
ncompoa += "</ol>";
document.getElementById('contenido').innerHTML = ncompoa;
But the result obtained is complete of all products included and not included.