File tree Expand file tree Collapse file tree
14. Exam - Fortune Cookies/solution-doncho/public Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ <h1 class="page-header col-md-6">
8282 < script src ="js/controllers/my-cookie.js "> </ script >
8383
8484 <!-- App: Loaders -->
85+ < script src ="js/app/polyfills/array.js "> </ script >
8586 < script src ="js/app/data.js "> </ script >
8687 < script src ="js/app/templates.js "> </ script >
8788 < script src ="js/app/json-requester.js "> </ script >
Original file line number Diff line number Diff line change 1+ if ( ! Array . prototype . find ) {
2+ Array . prototype . find = function ( predicate ) {
3+ if ( this === null ) {
4+ throw new TypeError ( 'Array.prototype.find called on null or undefined' ) ;
5+ }
6+ if ( typeof predicate !== 'function' ) {
7+ throw new TypeError ( 'predicate must be a function' ) ;
8+ }
9+ var list = Object ( this ) ;
10+ var length = list . length >>> 0 ;
11+ var thisArg = arguments [ 1 ] ;
12+ var value ;
13+
14+ for ( var i = 0 ; i < length ; i ++ ) {
15+ value = list [ i ] ;
16+ if ( predicate . call ( thisArg , value , i , list ) ) {
17+ return value ;
18+ }
19+ }
20+ return undefined ;
21+ } ;
22+ }
You can’t perform that action at this time.
0 commit comments