Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A way to clone array on purpose when using chain call. #1323

Closed
Labels
@le0nik

Description

@le0nik

Hello!

In 3.10.0:

var arr = [1, 2, 3];var arr2 = _.chain(arr)    .slice()    .reverse()    .value();console.log('arr2: ', arr2); // [3, 2, 1]console.log('arr: ', arr); // [3, 2, 1]// in 3.9.3 and prior to it 'console.log(arr);' would return [1, 2, 3]. The initial array would be untouched.

First i'd like to say, that it is unintuitive, undocumented(nothing in the changelog) and it broke a part of our project. Supposing, that the change was intentional(short fusion), the question is: is there a way to clone an array on purpose, considering that_.clone and_.cloneDeep aren't chainable?

Thank you!

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp