background preloader

[js] Practical & explaination

Facebook Twitter

Functions overview. Underscore.js. Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. It’s the answer to the question: “If I sit down in front of a blank HTML page, and want to start being productive immediately, what do I need?” … and the tie to go along with jQuery's tux and Backbone's suspenders. Underscore provides 80-odd functions that support both the usual functional suspects: map, select, invoke — as well as more specialized helpers: function binding, javascript templating, deep equality testing, and so on. It delegates to built-in functions, if present, so modern browsers will use the native implementations of forEach, map, reduce, filter, every, some and indexOf. The project is hosted on GitHub. You can report bugs and discuss features on the issues page, on Freenode in the #documentcloud channel, or send tweets to @documentcloud.

Collection Functions (Arrays or Objects) _.every([true, 1, null, 'yes'], _.identity); => false. Prism. Cookie.js !! Very useful. Moment.js - A lightweight javascript date library. JSHint - Check syntax. Spin.js - Loader. TypedArray.org | JavaScript for interactive developers. [JS] Array and Matrix Initialization, Sorting Dictionaries and Objects - included to GIST.JS. Functions Explained. A Deep Dive into JavaScript Functions Based on my readership I have to assume most of you are familiar with JavaScript already.

Therefore, it may seem odd to include a post on functions. After all, they are one of the most rudimentary components of JavaScript. My assertion is this, just as a person can speak a language without the ability to read or write it, so too can developers use functions in JavaScript and yet be blissfully unaware of their complexities. Typically developers only become aware of the specifics of functions when something they wrote explodes in their face. My goal in this section is to expose the intricacies of JavaScript functions to you, which will hopefully save you from having to pull syntactic shrapnel from your codebase. A word of caution before we begin; JavaScript is only as good as its interpreter. Blocks in JavaScript Before we can understand functions in JavaScript we have to understand blocks. Function Arguments Function Types Function Scopes.