+ 3

I'm stuck in the Template literal in the Country cards projects 😩😩 anyone please to help me

let country = readLine(); let capital = readLine(); //complete the code console.log(`Country: , Capital: `);

10th Oct 2023, 3:46 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
17 Réponses
+ 4
Emmaculate Moraa depending on which one they are asking for the template-literals are console.log(`Country: ${country}`); console.log(`Capital: ${capital}`);
10th Oct 2023, 4:01 AM
BroFar
BroFar - avatar
+ 3
let country = readLine(); let capital = readLine(); //copy and paste the code console.log(`Country: ${country}, Capital: ${capital} `);
11th Oct 2023, 1:50 PM
Andrew Adakole
Andrew Adakole - avatar
+ 1
Please put the programming language in the tag when creating a new thread, so we know which language we are talking about. Also write down the course name and module name is helpful. If it is a practice or challenge, please write down the description, if available, also the input and expected output. If I'm not mistaken, you need to output the value stored in the variables, but your code is outputting a string.
10th Oct 2023, 3:55 AM
Wong Hei Ming
Wong Hei Ming - avatar
+ 1
Emmaculate Moraa do you remember reading about the dollar sign and the curl brackets inside the backticks ...
10th Oct 2023, 4:07 AM
BroFar
BroFar - avatar
+ 1
Emmaculate Moraa so if I asked you to add the variables to the template-literal you would understand console.log (`Country: ${country} Capital: ${capital} `);
10th Oct 2023, 4:17 AM
BroFar
BroFar - avatar
+ 1
Emmaculate Moraa no you do not hard-coded any answers ( variables )
10th Oct 2023, 4:20 AM
BroFar
BroFar - avatar
+ 1
You don't do anything further Emmaculate Moraa just hit run. if you see kodie the ai it can help you with the solution as well let country = readLine(); let capital = readLine(); //complete the code console.log(`Country: ${country}, Capital: ${capital}`);
10th Oct 2023, 4:25 AM
BroFar
BroFar - avatar
+ 1
Emmaculate Moraa Are you entering readline() or readLine() ??? readLine(); is correct.
10th Oct 2023, 4:31 AM
BroFar
BroFar - avatar
0
The question states that I use code format above to output the following Output Country: Portugal Capital:Libson
10th Oct 2023, 4:02 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
The course is Template literals
10th Oct 2023, 4:04 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
I believe the hint is given in the bottom of the description in case the students forgot what they learned.
10th Oct 2023, 4:08 AM
Wong Hei Ming
Wong Hei Ming - avatar
0
Yeah I remember them
10th Oct 2023, 4:13 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
Am I supposed to enter any spring inside the readline brackets? Because the code says that there is a reference error
10th Oct 2023, 4:14 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
Yeah I understand those literals The problem is that the code does not run I don't know what I'll include in the readline ()
10th Oct 2023, 4:24 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
It still says reference errors
10th Oct 2023, 4:29 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
The AI needs fee and am not able to pay
10th Oct 2023, 4:29 AM
Emmaculate Moraa
Emmaculate Moraa - avatar
0
I believe the hint is given in the bottom of the description in case the students forgot what they learned.
10th Oct 2023, 4:44 AM
Swapnil Dutta
Swapnil Dutta - avatar