That's not plain Javascript. That's Lodash through and through. The array transformation methods built into Javascript run to completion after every step building multiple copies of the array as each transformation is applied. Lodash's chain and related methods do not make multiple copies of the array during transformation.