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 calculate(num) { var str = "0"; for (var i = 1; i <= num; i++) { if (num % i == 0) { str += ',' + i; } } alert(str); } calculate(232);
http://jsfiddle.net/67qmt/