Skip to content

Change documentation for sortBy when use second params as array #4376

@theGABS

Description

@theGABS

Hi, currently I see next example at https://lodash.com/docs/4.17.14#sortBy

_.sortBy(users, ['user', 'age']);
// => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]

The problem here - I don't understand users first sorted by age, then by name. Or visa versa ( first by name, then by age).

It will be awesome if you change default data to something like

var users = [
  { 'user': 'fred',   'age': 48 },
  { 'user': 'barney', 'age': 50 },  // CHANGES HERE, 36 -> 50
  { 'user': 'fred',   'age': 40 },
  { 'user': 'barney', 'age': 34 }
];

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions