0
I need help! The code above gives me the exacte result but it cant be passed cause its undefined I dont why
function main() { var country = readLine(); var capital = readLine(); console.log(countryCard(country, capital)); } function countryCard(country, capital){ //complete the function //use backtick (` `) for template literal console.log(`Name:${country},Capital:${capital}`); }
3 Antworten
+ 3
It prints undefined because you are doing console.log(countryCard(…)) but the function countryCard doesn’t returns nothing.
Change the console.log from countryCard into a return
return ‘Name:${country},Capital:${capital}’
+ 2
Try this if it does not work let me know
https://code.sololearn.com/WRQ0FEDvGoCo
Keep learning & happy coding :D
0
Don't expect people to put effort into helping you if you're not even willing to put any effort into asking your question.
https://www.sololearn.com/Content-Creation-Guidelines?
https://code.sololearn.com/Wv5gTHy1N6Ji/?ref=app
https://www.sololearn.com/discuss/1316935/?ref=app
https://code.sololearn.com/W3uiji9X28C1/?ref=app
https://www.sololearn.com/discuss/333866/?ref=app