Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function foo(x: Item[], y: object): boolean {
  2.     x.forEach((a) => {
  3.         let c = false;
  4.        
  5.         if (a.name === y.name) {
  6.             console.log('dupa');
  7.             c = true;
  8.         }
  9.        
  10.         if (c === false) {
  11.             console.log(2);
  12.             return false;
  13.         }
  14.     });
  15.  
  16.     return true;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement