Question: So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up. 

```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
    x = y;
    y = z;
    z = x + y;
    if (z % 2 == 0)
    {
        sumeven += z;
    }
}
cout << sumeven;

```

thr problem im having is with the 

```
x=y; y=z; z=x+y;

```

everything else i understand. 

can someone explain this to me please. Im not sure how i would have known to do this without looking it up.

Answer: 
You can use [`Array.prototype.find()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).

```js
const people = [
  { firstName: 'Bob', lastName: 'Smith', status: 'single' },
  { firstName: 'bobby', lastName: 'Suxatcapitalizing', status: 'single' },
  { firstName: 'Jim', lastName: 'Johnson', status: 'complicated' },
  { firstName: 'Sally', lastName: 'Fields', status: 'relationship' },
  { firstName: 'Robert', lastName: 'Bobler', status: 'single' },
  { firstName: 'Johnny', lastName: 'Johannson', status: 'complicated' },
  { firstName: 'Whaley', lastName: 'McWhalerson', status: 'relationship',
    'rogueBonusKey': 'bob likes salmon' },
]

const searchString = 'Bob';

const person = people.find(({ firstName }) => firstName.toLowerCase() === searchString.toLowerCase());

console.log(person);
```
Array.prototype.filter() also works as well:

```
const includesQuery = (value) => {
      return value['SOME_KEY'].toLowerCase().includes(query.toLowerCase());
    }
const filtered = this.myArray.filter(includesQuery);

console.log(filtered);

```