Skip to content

forEach + spread behaviour changed in 4.17 #2825

@Loghorn

Description

@Loghorn

If you try this simple program with Lodash 4.16.6 and 4.17.1 you'll get two very different results:

var _ = require('lodash');
var test = _.spread(function(a, b, c, d) { console.log(a, b, c, d); });
_.forEach([
  ['X', 'Y'],
  ['Z']
], test);

With Lodash 4.16.6

X Y undefined undefined
Z undefined undefined undefined

With Lodash 4.17.1

X Y 0 [ [ 'X', 'Y' ], [ 'Z' ] ]
Z 1 [ [ 'X', 'Y' ], [ 'Z' ] ] undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions