0
Introduction to JavaScript, Functions lesson
the practice part for the lesson is to correct the following code wich doesnt work; function welcome(){ let name = readLine(); //rediseña la función console.log('Welcome, user'); } //call the function => then the solution for the problem is as following, but still doesnt work: function welcome(){ let name = readLine(); console.log('Welcome, ${name}'); } welcome();
2 Respostas
+ 3
You need to use backticks to utilize string interpolation. Single or double quotes denotes regular string which doesn't support string interpolation
console.log( `Welcome, ${name}` );
Like that ...
+ 1
Great, thanks a lot