1
感謝您提供任何建議。我編寫的代碼基於codeacademy.com(偉大的學習資源,順便說一句)。它應該讀取文本並用我的名字填充數組。我似乎無法找到它爲什麼鎖定我使用它的瀏覽器。請幫忙。新增javascript代碼問題循環
/**
* Created by Jonathan on 2/26/14.
*/
/*jshint multistr:true */
var text = "I realize me name in Jonathan and because my name is Jonathan \
I am sure that I have lots of Jonathan shoes";
var myName = "Jonathan";
var hits = [];
for (var i = 0; i < text.length; i++) {
if (text[i] === "J") {`enter code here`
for (var j = i; j < j + myName.length; j++) {
hits.push(text[j]);
}
}
}
如果字符串的長度大於1,j