Skip to content

Instantly share code, notes, and snippets.

@froots froots/example.js
Created Nov 1, 2012

Embed
What would you like to do?
console.log during an Underscore.js chain()
_.chain(myData)
.flatten()
.log()
.reverse()
.log()
.filter(function(item) { return item.active; })
.value();
_.mixin({
log: function(arg) {
console.log(arguments);
return arg;
}
});
@froots

This comment has been minimized.

Copy link
Owner Author

froots commented Nov 1, 2012

Don't know why I didn't do this before. Very handy for quick debugging of intermediate chain states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.