Skip to content

Instantly share code, notes, and snippets.

@basekays
Created January 24, 2017 23:18
Show Gist options
  • Select an option

  • Save basekays/808c26e384f5912d1bb647d9e387e955 to your computer and use it in GitHub Desktop.

Select an option

Save basekays/808c26e384f5912d1bb647d9e387e955 to your computer and use it in GitHub Desktop.
reduce
var memoInCallback, itemInCallback;
_.reduce(['item'], function(memo, item) {
memoInCallback = memo;
itemInCallback = item;
}, 'memo');
expect(memoInCallback).to.equal('memo');
expect(itemInCallback).to.equal('item');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment