Skip to content

倒序迭代器

javascript
const reverseEach = (ary, cb) => {
  for (let i = ary.length - 1; i >= 0; i--) {
    cb.call(ary, i, ary[i])
  }
}