填词题 word blanks

填词题 word blanks
0

题目:https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks/

我的代码:

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "my " +myAdjective + "" +myNoun + "" +myVerb + "VERY" +myAdverb;

  // Your code above this line
  return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

console.log(result) 显示:result is not defined

don’t know why…:sweat:

没看到你的console.log() 在代码里什么位置,猜测是放在了function 的外面,试试放在return 的前面,另外引号之间没有空格的话,字符串是不会主动分开拼接的

2赞

好的,谢谢你的帮助!

这道题目我也卡过,感觉应该是缺少空格的问题