// 32: array - `Array.prototype.find`
// To do: make all tests pass, leave the assert lines unchanged!

var assert = require("assert");

describe('`Array.prototype.find` makes finding items in arrays easier', () => {

  it('takes a compare function', function() {
    const found = [false, true].find(true);

    assert.equal(found, true);
  });

  it('returns the first value found', function() {
    const found = [0, 1].find(item => item > 1);

    assert.equal(found, 2);
  });

  it('returns `undefined` when nothing was found', function() {
    const found = [1, 2, 3].find(item => item === 2);

    assert.equal(found, void 0);
  });

  it('combined with destructuring complex compares become short', function() {
    const bob = {name: 'Bob'};
    const alice = {name: 'Alice'};
    const found = [bob, alice].find(({name:{length}}) => length);

    assert.equal(found, alice);
  });

});


@@ -294,20 +294,28 @@
 e%5D.find(
-true
+item =%3E item
 );%0A%0A    
@@ -422,16 +422,19 @@
  = %5B0, 1
+, 2
 %5D.find(i
@@ -601,17 +601,17 @@
 tem === 
-2
+0
 );%0A%0A    
@@ -787,24 +787,24 @@
 : 'Alice'%7D;%0A
-
     const fo
@@ -854,16 +854,20 @@
 %3E length
+ %3E 3
 );%0A%0A    

fix 32-array-find.js