function if_consecutive(array,num) {
    // check if there are certain number (argument 'num') of consecutive identical items in the array
	var i = 1;
    var counter_i = 1;
    var counter = [];
    while (i < array.length) {
        if (array[i]==array[i-1]) {
            counter_i++;
            counter = counter.concat(counter_i);
        } else {
            counter_i = 1;
            counter = counter.concat(counter_i);
        };
        i++;
    }
  if (counter.includes(num)){
    return true;
  } else {
    return false;
  }
}