遍历数组
实例
const cars = ["BMW", "Volvo", "Mini"];
let text = "";
for (let x of cars) {
text += x;
}
亲自试一试
遍历字符串
实例
let language = "JavaScript";
let text = "";
for (let x of language) {
text += x;
}
遍历数组
实例
const cars = ["BMW", "Volvo", "Mini"];
let text = "";
for (let x of cars) {
text += x;
}
亲自试一试
遍历字符串
实例
let language = "JavaScript";
let text = "";
for (let x of language) {
text += x;
}