console.group("Fri Dec 20 2019 14:41:45 GMT+0800 (中國標準時間) appservice 生成錯誤")
console.error("file: pages/index/index.js\n unknown: Unexpected token, expected , (33:11)\n 31 | },\n 32 | \n> 33 | for(i = 0; i=<lth; ++i) {\n | ^\n 34 | this.setData({x1: x1+word2(i) })\n 35 | if (i >lth ) break;\n 36 | }")
console.groupEnd()
上面的提示錯誤,對陣列word 求和,JS 代碼如下:
for(i = 0; i=<lth; ++i) {
this.setData({x1: x1+word2(i) })
if (i >lth ) break;
}
有什么問題嗎?
uj5u.com熱心網友回復:
LTH是陣列長度。X1是求和的值。
uj5u.com熱心網友回復:
全域定義陣列和總和,然后在計算
str: [1, 2, 3],
num: 0,
for (var i = 0; i < that.data.str.length; i++) {
that.data.num += that.data.str[i];
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/78524.html
標籤:微信開發
上一篇:求助andriod studio 開發游戲 程式包com.bulletphysics.collision.disp不存在問題
