I would like to remove all falsy values from an array. Falsy values in JavaScript are false, null, 0, \"\", undefined, and NaN.
I see you never accepted an answer. Is the problem that you are relying on Logger.log or console.log to see if the null removal worked? I think the filter suggested by @LoremIpsum is the cleanest solution.
const src2DArr = [[34], [75], [30], [48], [976], [], [178], [473], [51], [75], [29], [47], [40]];
Logger.log("src2DArr: " +JSON.stringify(src2DArr));
// [[34],[75],[30],[48],[976],[],[178],[473],[51],[75],[29],[47],[40]]
var src2DArr1 = src2DArr.filter(Boolean);
Logger.log("src2DArr1: " + JSON.stringify(src2DArr1));
// [[34],[75],[30],[48],[976],[],[178],[473],[51],[75],[29],[47],[40]]