I have a question in a code:
I have these two arrays:
var listaLeituras= [12,13,14,15,16,17,18];<br>
var leiturasRealizadas = [12,15,18];
In the end, I needed a code to show in a third array the unrealized readings, which would be the numbers 13,14,16,17. I tried the code below, however, without success:
var leiturasIgnoradas = listaLeituras.filter(function(leitura) {<br>
return leiturasRealizadas.indexOf(leitura) < 0;<br>
});
NOTE: My application is based on pure Javascript and can not use external libraries.