Javascript – Why does using Array.prototype.slice during iteration behave unexpectedly?
Given an array, I want to generate its "prefixes", meaning for an array of size N, I want one array containing the first element, an array containing the first two, an array containing the first three, and so on until…