+ 1
What is the problem in my code?
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 return(`Name:${country},Capital:${capital}`); }
8 Antworten
0
without task description it's hard to say what's the expected output...but probably something like:
Name: country, Capital: capital
but your code output:
Name:country,Capital:capital
+ 2
Solved. Thanks a lot!!
+ 2
let country = readLine();
let capital = readLine();
//observe the output format carefully... we have to give one space after colon and coma
console.log(`Country: ${country}, Capital: ${capital}`);
+ 1
//Please Subscribe to my youtube channel
//channel name: Fazal Tuts4U
function main() {
var country = readLine();
var capital = readLine();
console.log(countryCard(country, capital));
}
function countryCard(country, capital){
return(`Name: ${country}, Capital: ${capital}`);
}
0
you probably forgot some space(s) in the result string ^^
0
that's what I guessed:
return(`Name: ${country}, Capital: ${capital}`);
notice the three spaces added (one after each colon, one other after comma) ^^
- 1
Your Output
Name:France,Capital:Paris
Expected Output
Name: France, Capital: Paris
- 2
Code example please