const arr: (number | null)[] = [1, null, 2, 3, null];
arr.filter(x => x).map(x => x);
↑こうやるとmapの中のxがnumber|nullのままなのムカつかない?