Skip to content
Malexion edited this page Oct 31, 2016 · 6 revisions

__.all(obj, func, [all])

  • obj Object to iterate over, can be anything that can be enumerated for in, arrays and numbers are handled differently.
  • func Functional iterator passed (value, key, event).
  • value Raw value of the iteration.
  • key Respective key under which you can find the value.
  • event Event options, { stop: false } allows you to prematurely stop the iteration.
  • [all] [Optional] param, signifies to not check HasOwnProperty() which is in place for prototype modification protection.

Examples

__.all({ item: 1, key: 'pair' }, (value, key, event) => {
   console.log(key);
   event.stop = true;
});

__.all([ 45, 406, 100, 1, -20, { key: 'pair' }], (value, key, event) => {
   console.log(value);
});

__.all(5, (count, total, event) => {
   console.log('{0}/{1}'.format(count, total));
})
Clone this wiki locally