1 | function arrayEach (list, iterate, context) {
|
2 | if (list) {
|
3 | if (list.forEach) {
|
4 | list.forEach(iterate, context)
|
5 | } else {
|
6 | for (var index = 0, len = list.length; index < len; index++) {
|
7 | iterate.call(context, list[index], index, list)
|
8 | }
|
9 | }
|
10 | }
|
11 | }
|
12 |
|
13 | module.exports = arrayEach
|