John Lindal![]()
Adds most of the higher-order functions from array-extras to the YUI Global Object, so you can use them for arrays, objects, and NodeLists.
Example usage.
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.05.23-19-56'
}).use('gallery-funcprog', function(Y)
{
var result = Y.filter({a:1,b:2,c:3,d:4}, function(value, key)
{
return value >= 3 || key == 'a';
});
var squares = Y.map({a:1,b:2,c:3,d:4}, function(value, key)
{
return v*v;
});
var sum = Y.reduce({a:1,b:2,c:3,d:4}, 0, function(sum, value)
{
return sum + value;
});
});
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info