JavaScript ecma6 Challenge help | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

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}`); }

10th May 2021, 10:43 PM
Sean
Sean - avatar
1 Resposta
+ 2
In main you are logging the return value of countryCard, which is undefined
10th May 2021, 11:17 PM
Benjamin JĆ¼rgens
Benjamin JĆ¼rgens - avatar