Skip to content

Instantly share code, notes, and snippets.

@khoand0000
Last active December 30, 2015 12:47
Show Gist options
  • Save khoand0000/89a2207bb50c0b0f7e11 to your computer and use it in GitHub Desktop.
Save khoand0000/89a2207bb50c0b0f7e11 to your computer and use it in GitHub Desktop.
using object-oriented or functional style with underscore?

From http://underscorejs.org/#chaining

You can use Underscore in either an object-oriented or a functional style, depending on your preference

I decided that using functional style even I love OOP because:

  • I want code style is consistent when using jquery, _.php (_.php uses static functions for usage, it is similar to functional style), _.js
  • There is a special case: chaining using OO style, I known. It is exception.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment