##NOTE Currently the npm and bower packages are commited to source control but I plan to make a branch available that does not contain these packages.
##Overview This repository contains the examples for my book "Learning Underscore.js".
The folders and examples are named in such a way they can be explored outside of the book context.
If these examples prove useful to the community I intend to create a branch after the book is finished (or even a separate fork) and accept further additions or even significant changes unrelated to the content of the book.
##Examples index The examples are organised in these sections (that match a specific chapter of the book):
Getting started (Chapter 1: Getting started with Underscore.js)
- Starter example with ECMAScript 5 - code, preview
- Starter example with _.find() - code, preview
- Starter example with _.countBy() - code, preview
- Examples for _.map() and _.reduce() - code, preview
- Examples for _.map() and _.reduce() with IIFE (immediately invoked function expression) - code, preview
- Revealing module pattern - code, preview
- Examples for _.map() and _.reduce() with revealing module pattern - code, preview
- Examples for _.map() and _.reduce() with local dependencies via Bower - code
- Example for _.map() and _.reduce() with Jasmine tests - code
Collections (Chapter 2: Using Underscore.js with collections)
- Examples for _.each() using object properties and set context - code
- Examples for _.map() and _.reduce() using object properties - code
- Searching examples using _.find(), _.some(), _.findWhere(), _.contains - code
- Filtering examples using _.filter(), _.where(), _.reject() - code
- Aggregations examples using _.min() and _.max() - code
- Transformations examples using _.sortBy(), _.groupBy(), _.indexBy(), _.countBy - code
Arrays, functions and objects (Chapter3: Using Underscore.js with arrays, functions and objects)
- Arrays examples using _.first(), _.rest(), _.last(), _.initial(), _.union(), _.uniq(), _.intersection(), _.difference(), _.zip() - code
- Objects examples using _.keys(), _.pairs(), _.functions(), _.pick(), _.omit() - code
- Object assertions using _.isX() functions like. _.isNumber(), _isNull() and others - code
- Functions example using _.bind() - preview
- Functions examples using _.partial(), _.wrap() - code
OOP and FP paradigms (Chapter 4: Programming paradigms with Underscore.js)
- Object inheritance examples with ECMAScript 5 - code
- Classes and validation examples with Underscore - code
- Adopting a functional programming(FP) style - code
- FP examples using _.chain(), value(), _.tap() - code
Browser, Node.js and database examples (Chapter 5: Using Underscore.js in the browser, on the server, and with the database)
- Browser examples using _.template() with different styles of templates - code
- Examples of Node.js modules - code
- Examples of JavaScript code converted to Node.js modules and tests for Node.js modules - code
- Examples for using Underscore with MongoDB - code
- Examples for using Underscore with PostgreSQL - code
Advanced topics part 1 (Chapter 6: Related Underscore.js libraries and ECMAScript standards)
- Underscore-contrib examples - code
- lodash examples - code
- Using ES6 with Babel directly in browsers - code
- Using ES6 with Babel CLI in browsers - code
- Using ES6 with Babel CLI in Node.js - code
- Starter ES6 examples with ES6 tests (in a project using Babel CLI for code execution and jasmine-es6 for testing) - code
Advanced topics part 2 (Chapter 7: Underscore.js build automation and code reusability)
- Using Gulp.js to automate the preview and test of an existing example - code
- Using Browserify to enable CommonJS modules that are reusable between client and server for an existing example - code
- Using Browserify and Babel to enable ES6 modules that are reusable between client and server for an existing example - code