Template Literals | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Template Literals

Template Literals You need to make country cards for a school project. The given program takes the country and its capital name as input. Task Complete the code to return a string in the format you are given in the sample output: my code : // test 1 var countryTest1 =("Spain"); var capitalTest1 = ("Madrid"); console.log(` Country: ${countryTest1}, Capital: ${capitalTest1}`); but it works with the first one only, how can I fix all tests from test 1 to test 5?

16th Dec 2022, 6:24 AM
abdulla Nsour
abdulla Nsour - avatar
4 Answers
+ 7
There should be a part of the code which were meant to read input of country & capital name in original code. You should use it to read input rather than assigning values manually in the code. P.S. Try to search the forum, it's part of the lesson, so presumably someone had already posted a question around it and got some suggestions about what to do.
16th Dec 2022, 7:36 AM
Ipang
+ 5
Pls some one help me this template literal practice Even after I done the sollution it's not completed let country = readLine(); let capital = readLine(); //complete the code console.log(Country:${country},Capital:${capital});
21st Mar 2023, 11:03 AM
Niyas S
Niyas S - avatar
+ 3
Can you send any pics please ?
12th Mar 2023, 3:24 PM
Dattatreya Gunaga
Dattatreya Gunaga - avatar
0
Help me not working test case are wrong but I did correctly
21st Dec 2023, 4:01 PM
Sai Deepak Boddepalli
Sai Deepak Boddepalli - avatar