0.0.1 • Published 9 years ago
u-each v0.0.1
u-each
A uniform way to iterate over arrays and objects while preserving the ability to break the loop if needed
Install
npm install --save u-eachUse
const each = require('u-each')
each([1, 2, 3], (item, index, arr) => {
  if (item === 2) {
    return 'break'
  }
})
// no need to check hasOwnProperty
each({ one: 1, two: 2 }, (key, value, obj) => {
  if (key === 'two') {
    return 'break'
  } else {
    return 'continue'
  }
})0.0.1
9 years ago