3 ms·
Array.prototype.sort destructively modifies the array, which is typically not considered a part of the functional paradigm. You could make a case for pragmatism
by andreareina 9y ago
Array.prototype.sort destructively modifies the array, which is typically not considered a part of the functional paradigm. You could make a case for pragmatism if the array were purely local to the function (i.e. not passed into it), so that nothing outside the function would notice anything being mutated.