Skip to content

Chaining example indentation #922

Closed
Closed
@benatkin

Description

First take all the time you want with this one, as it's just documentation aesthetics.

Is this the intended indentation? From the chaining documentation:

_.chain(lyrics)
  .map(function(line) { return line.words.split(' '); })
  .flatten()
  .reduce(function(counts, word) {
    counts[word] = (counts[word] || 0) + 1;
    return counts;
}, {}).value();

It outdents 4 after the body of the anonymous function that gets passed to .reduce. It would seem that it should be outdented by 2. This would make indentation code folders fold it properly.

_.chain(lyrics)
  .map(function(line) { return line.words.split(' '); })
  .flatten()
  .reduce(function(counts, word) {
    counts[word] = (counts[word] || 0) + 1;
    return counts;
  }, {}).value();

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions