0

I've checked many times but since I'm new I'm constantly missing something. In the console, my list is does not appear as like this....and my output is like here

Everything is correct, but is there something I don't know about the console?

let input = prompt("What would you like to do?");
const todos= ['list app finish', 'js practice'];
while (input !== 'quit' && input !=="go away aysel"){ 
    if(input === 'list') {
        console.log('***********')
        for (let num = 0; num< todos.length; i++){
            console.log("${num} ${todos[num]}");
        }
        console.log('*************')
    }
    input= prompt('What would you like to do')
}
console.log('Good bye')

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
hartimX
  • 1
  • 2

1 Answers1

1

Template literals work with the backtick char `.
They do not work with string quotes like ' and "

so you need to change the logging to

console.log(`${num} ${todos[num]}`);
Gabriele Petrioli
  • 191,379
  • 34
  • 261
  • 317