1
2function divisors(integer) {
3 let i, flag = true;
4 let arr=[];
5
6
7 for(i = 2; i <= integer - 1; i++) {
8 if (integer % i == 0) {
9 flag = false;
10 arr.push(i)
11 }
12 }
13 if (flag == true)
14 console.log(integer + " is prime");
15 else
16 console.log(arr)
17}
18console.log(divisors(15))