JavaScript ecma6 Challenge help | Sololearn: Learn to code for FREE!


JavaScript ecma6 Challenge help

I need to the code to return name: and capital: but I keep returning both and an undefined part. What am I missing? function main() { var country = readLine(); var capital = readLine(); console.log(countryCard(country, capital)); } function countryCard(country, capital){ console.log(`"Name: ${country}, Capital: ${capital}`); }

5/10/2021 10:43:46 PM


1 Answer

New Answer


In main you are logging the return value of countryCard, which is undefined