I was expecting console log to print out multiples of 12, while logging the string “Not Divisable!” for every other number, however, every number is being printed up to 144, and the string is also being written out multiple times.
var table = [];
var countTwelve = 0;
function timesTable () {
while (table.length < 144){
if ( countTwelve % 12 === 0 ) {
console.log(table.push(countTwelve));
} else {
console.log("Not divisable!");
}
countTwelve++;
}
}
timesTable();