const divisors = integer => {
const array = [];
const numbers = [];
for (let i = 2; i < integer; i++) {
if (integer % i === 0) numbers.push(i);
}
return numbers.length > 0 ? `${numbers} \n ${integer} is prime.` : `${integer} is prime.`;
};
console.log(divisors(10));