Logging array indices, not values (JavaScript)
This question already has an answer here:
You have error in loop ( push(i)
instead of push(alphabet[i])
). Correct loop:
for (i=0; i<alphabet.length; i++) {
str.push(alphabet[i]);
console.log(str.join(""));
}
链接地址: http://www.djcxy.com/p/24548.html
上一篇: 没有参数的函数的c ++显式关键字