Just like group By, but for when you know your keys are unique.

speed dating hci method-25

Memo is the initial state of the reduction, and each successive step of it should be returned by iteratee. If no memo is passed to the initial invocation of reduce, the iteratee is not invoked on the first element of the list.

The first element is instead passed as the memo in the invocation of the iteratee on the next element in the list.

{year: 1918, newsroom: "The New York Times", reason: "For its public service in publishing in full so many official reports, documents and speeches by European statesmen relating to the progress and conduct of the war."} Returns the maximum value in list.

Underscore is a Java Script 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 j Query's tux and Backbone's suspenders.

Underscore provides over 100 functions that support both your favorite workaday functional helpers: map, filter, invoke — as well as more specialized goodies: function binding, javascript templating, creating quick indexes, deep equality testing, and so on. You can report bugs and discuss features on the issues page, on Freenode in the Iterates over a list of elements, yielding each in turn to an iteratee function.

A complete Test Suite is included for your perusal. The iteratee is bound to the context object, if one is passed.

If an iteratee function is provided, it will be used on each value to generate the criterion by which the value is ranked. If an iteratee function is provided, it will be used on each value to generate the criterion by which the value is ranked.

-Infinity is returned if list is empty, so an is Empty guard may be required. Infinity is returned if list is empty, so an is Empty guard may be required. Splits a collection into sets, grouped by the result of running each value through iteratee.

If iteratee is a string instead of a function, groups by the property named by iteratee on each of the values.

Given a list, and an iteratee function that returns a key for each element in the list (or a property name), returns an object with an index of each item.