I've encountered a problem that is wired for me as a beginner javascript coder.
here is my console when I try to log count
variable that is an array of arrays:
As I want to remove the empty arrays inside count
I added this line of code just above the count
log like this:
count = count.filter(e => e.length);
console.log(count);
I saw no difference so I tried to log the count
in a different way:
count = count.filter(e => e.length);
console.log("count: "+ count);
This time I can see something wired! the count
logs with other values! (Iknow these values but I don't know where are they in the first log and why the filter doesn't work)
Please help I'm confused. how I can remove empty arrays on count
?
The desired result would be: