$ 0 0 Array.prototype.sort works in-place & returns the same array. Try `this.attr("files", sorted.slice(0));` to clone the array.