将数组[“a”,“b”,“c”]转化为字符串;

function arrayToString( arr ){
    var str = '';
    for(var i =0;i<arr.length;i++){
        str = str + (arr[i]);
    }
    return str;
}
var arr = ['a','b','c'];
console.log(arrayToString(arr));
console.log(arr.join(''));
©️2020 CSDN 皮肤主题: 我行我“速” 设计师:Amelia_0503 返回首页