Q:

JavaScript - Check if one array has the same index from a second array

Let's say I have an object of
var people = [
  {name: 'John'}, // 0
  {name: 'James'}, // 1
  {name: 'Sue'}, // 2
  {name: 'Mary'}, // 3
  {name: 'Will'}, // 4
  {name: 'Lukas'}, // 5
  {name: 'Sam'} // 6
];

and then I have this array: var history = [0, 2, 4, 6]; // we have John, Sue, Will and Sam
Using Lodash, or general JavaScript, how can I make it to return true or false if a entered value is found inside the history[] array. 
For example, isInHistoryArray(5) would return false but isInHistoryArray(2) would return true

A:

For example
You have list-array of players in the small game:
var people = [
  {name: 'John'},
  {name: 'James'},
  {name: 'Sue'},
  {name: 'Mary'},
  {name: 'Will'},
  {name: 'Lukas'},
  {name: 'Sam'}
];

And you have array of the... actually connected people:
var history = [0, 2, 4, 6];

Okay, lets say that both containers are in the global scope for comfort. 
You can check it by this function body
function checkHistory(a){
for(var i = 0; i < history.length; i++){
   if(history[i] === a) return true;
}return false;}

