📅  最后修改于: 2022-03-11 15:02:22.996000             🧑  作者: Mango
let a = "foo";
// function for reversing a string
function reverseString(str) {
return str.split("").reverse().join("");
}
console.log(a); // "foo"
let b = reverseString(a);
console.log(b); // "oof"