I am just starting JS, and understand the concept of finding a factor. However, this snippet of code is what I have so far. I have the str variable that outputs nothing but the
function primeFactors(n) {
let arrPrime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79];
let divisor = 2,
divided = n,
arr = [],
count = 0, out = "";
while (divisor < n) {
if (divided % divisor == 0) {
arr.push(divisor)
divided /= divisor;
console.log(divisor);
}
else {
divisor++;
}
}
console.log(count);
// let news = arr.filter(num => num != ",")
// console.log(news);
// arr.slice(indexOf(map(",")), 1)
return arr;
}
let out = primeFactors(86240);
console.log(out);