📜  在javascript代码示例中使用for循环反转字符串

📅  最后修改于: 2022-03-11 15:04:13.690000             🧑  作者: Mango

代码示例1
// New For loop available after ES2015
function reverse(str){
    let reversed = '';
    for (let character of str){
        reversed = character + reversed;
    }
    return reversed;
}