javascript filter chainnig code example
Example 1: javascript factor chain
function factorChain(arr) {
for (let i = 0; i < arr.length - 1; i++) {
if ((arr[i + 1] % arr[i]))
return false
}
return true
}
Example 2: javascript factor chain
function calculate(num) {
var str = "0";
for (var i = 1; i <= num; i++) {
if (num % i == 0) {
str += ',' + i;
}
}
alert(str);
}
calculate(232);