javaScript Repeat Element в массиве
Array(5).fill(2)
//=> [2, 2, 2, 2, 2]
Inexpensive Ibis
Array(5).fill(2)
//=> [2, 2, 2, 2, 2]
function isInArray(value, array) {
return array.indexOf(value) > -1;
}