有人请告诉我以下代码有什么问题吗?我是javascript的新手,我知道某处有一个丢失的逗号。谢谢。
i = 1:12
((i - 2) %% 12) + 1
[1] 12 1 2 3 4 5 6 7 8 9 10 11
答案 0 :(得分:2)
bakeTime和bakeTemp都丢失了逗号。 mixInstructions函数也是如此,但它还没有必要。
答案 1 :(得分:2)
您在bakeTime
和bakeTemp
之后缺少逗号,并且您的函数中遗漏了this
" and bake at " + bakeTemp + " for " + bakeTime
。
var cake = {
firstIngredient: "milk",
secondIngredient: "eggs",
thirdIngredient: "cakemix",
bakeTime: 22,
bakeTemp: 420,
mixingInstructions: function() {
return "Add " +
this.firstIngredient + " to " + this.secondIngredient + " and stir with " + this.thirdIngredient + " and bake at " + this.bakeTemp + " for " + this.bakeTime + " minutes.";
}
};
console.log(cake.mixingInstructions())
答案 2 :(得分:2)
对@Stephen L的跟进,
你忘了在import pandas as pd
Data = pd.DataFrame({'L1': [1,2,3,4,5], 'L2': [6,7,3,5,6], 'ouptput':[10,11,12,13,14]})
Data
答案 3 :(得分:2)
返回“添加”
后,您也错过了“+”答案 4 :(得分:2)
您有以下3个错误:
+
"Add"
this.
中缺少bakeTemp
而返回字符串中缺少bakeTime
return "Add " + this.firstIngredient + " to " + this.secondIngredient + " and stir with " + this.thirdIngredient + " and bake at " + this.bakeTemp + " for " + this.bakeTime + " minutes.";
var cake = {
firstIngredient: "milk",
secondIngredient: "eggs",
thirdIngredient: "cakemix",
bakeTime: 22,
bakeTemp: 420,
mixingInstructions: function() {
return "Add "+
this.firstIngredient + " to " + this.secondIngredient + " and stir with " + this.thirdIngredient + " and bake at " + this.bakeTemp + " for " + this.bakeTime + " minutes.";
}
};
console.log(cake.mixingInstructions());