underscore js n.
Skip this Video
Loading SlideShow in 5 Seconds..
Underscore.js PowerPoint Presentation
Download Presentation

Loading in 2 Seconds...

play fullscreen
1 / 11

Underscore.js - PowerPoint PPT Presentation

  • Uploaded on

Underscore.js. Moohanad Hassan Maedeh Pishvae. OOP vs. Functional Programming?. OOP Fixed set of operation on things  A s your code evolves, you add new things (like a class) FP  F ixed set of  things

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Underscore.js' - carina

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
underscore js


Moohanad Hassan


oop vs functional programming
OOP vs. Functional Programming?


  • Fixed set of operation on things
  •  As your code evolves, you add new things (like a class)


  •  Fixed set of things
  • As your code evolves, you add newoperations  (like a function) on existing things
functional programming
Functional Programming


  • Uses functions to turns one value into another 
  • Taking a value, and returns a new value with no “side effect”
  • Side effect: internal changes doesn’t affect outside of function
what is underscore
What is Underscore?

Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Ruby,but without extending any of the built-in JavaScript objects.

  • jQuery does DOM (Document Object Model) manipulation and animation extremely well.
  • DOM: Virtual map of webpage loaded on browser
  • Most of jQuery functionality deals with the DOM, so it has little purpose outside the browser
jquery and underscore go hand in hand
jQuery and Underscore go hand in hand
  • jQuery doesn’t deal with anything in the higher or lower levels
  • For higher level: Backbone or Knockout
  • For lower level: Underscore
underscore complements jquery
Underscore Complements jQuery
  • Complements jQuery by its functional support
    • Collections
    • Arrays
    • Functions
    • Objects
    • Utilities


  • No other dependencies
  • Adds very little overhead to your total script
  • Can be used on the client or server 
  • Good for MVC or non-DOM code
  • Doesn’t modify built-in objects
underscore is flexible
Underscore Is Flexible
  • Functional or Object-Oriented Style
  • Chainable
    • Chain method tells Underscore to return wrapped object
    • Value method returns the final at the end

Good Libraries Reduce the Burden