The arrow function you are using as a filter is only returning undefined items, but none of your items in the array are undefined, resulting in an empty array. However, I can see where the confusion might be coming from.
array[10] = 10
This line does not set the length of the array; it sets a specific item to the value of 10. So after this line, your array will have 4 elements: 1, 2, 3, and... 10.
In an array, you can specify the index for a particular value. If you omit it, the next index will simply increment by 1. Try this:
var array = [1, 2, 3];
array[10] = 10;
array.forEach((value, index) => console.log(value, index));
If you run this code on JSFiddle: https://jsfiddle.net/eetmkd95/1/, you will see the output displayed as:
1 0
2 1
3 2
10 10
Why? Because when you don't specify the index, it increments based on +1, and if you do specify the index, it places the value at that index. Remember, you are specifying the INDEX, not the length of the array.
Now try this piece of code:
var array = [1, 2, 3];
array.length = 10;
array[8] = 10;
array.forEach((value, ix) => console.log(value, ix));
console.log(array.length);
You may notice that even though the length property reports 10, forEach only prints 4 lines. This happens because forEach only displays items with number indexes that actually exist in the array. Also, it's worth noting that the reliability of the length property can vary based on whether you set it to a lower or higher value.
To further understand this concept, consider reading "You Don't Know JS" by Kyle Simpson, specifically the "Array(..)" section on page 44 in the "Types & Grammar" book. Additionally, you may find this resource helpful: