Divisible by 9 problem
Hello and good day folks.
I'm stuck on task 8 - Divisible by 9 from JS basic.
I cannot seem to find a solution how to print the numbers separated with space.
Any help will be welcomed.
Here's my code:
function divisible(input, inputB) {
first = Number(input);
second = Number(inputB);
let sum = 0;
let output = '';
for (let i = first; i < second; i++) {
if (i % 9 === 0) {
sum += i;
output += i;
}
}
console.log(`${sum}`);
console.log(`${output}`);
}