const randElem = (min, max) => {
let rnd = Math.round(Math.random() * (max - min) + min)
return rnd == 1 ? randElem(min, max) : rnd
}
const shuffle = array => array.sort(() => Math.random() - 0.5)
const getArray = n => {
let array = Array.from({ length: n }, () => randElem(-65536, 65536))
array.push(...[1, 1])
return shuffle(array)
}
console.log(getArray(10))