Is it bad to use code like:
var a = [1,2,3,4]; a.length = 2; // 3 and 4 are removed
Does it have decent browser support? Do the removed val
It is not an anti pattern. It is supported in all major browsers. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length