45f266e6746ff855ef40e3e81fe305e9dcdd0394
[platform/framework/web/crosswalk-tizen.git] /
1 define(['../function/makeIterator_'], function (makeIterator) {
2
3     /**
4      * Returns the index of the last item that matches criteria
5      */
6     function findLastIndex(arr, iterator, thisObj){
7         iterator = makeIterator(iterator, thisObj);
8         if (arr == null) {
9             return -1;
10         }
11
12         var n = arr.length;
13         while (--n >= 0) {
14             if (iterator(arr[n], n, arr)) {
15                 return n;
16             }
17         }
18
19         return -1;
20     }
21
22     return findLastIndex;
23
24 });