How to read an array of objects and return only objects that contain the same value in multiple attributes? I made this object array as an example.
var arrayDeObjetos = [
{"dia":1 , "desc":"Nigth","mes":1},
{"dia":1 , "Descricao":"Brilha","mes":1},
{"dia":2 , "desc":"Urna","mes":2},
{"dia":3 , "Descricao":"Covas","mes":1},
{"dia":2 , "desc":"Mario Corvas","mes":1},
{"dia":4 , "Desc":"Estrelas","mes":2}
];
In this Array I have several objects I wanted to group all and a new array that contains an object with all containing dia = 1
and mes = 1
another object that contains all with dia = 2
and mes = 2
The end result has to be something like
var resultado = [
[
{"dia":1,"mes":1,"desc":"descricao AQI"},
{"dia":1,"mes":1,"desc":"Outra desc"}
],
[
{"dia":2,"mes":2,"desc":"outro mes"},
{"dia":1,"mes":1,"desc":"outra coisa"}
]];