2023-08-13T05:44:02.png

//反转数组

var d = [1,2,3,4,5];
console.log(d);

//反转,5,4,3,2,1
d.reverse();
console.log(d);


//helloworld 字符串反转显示:dlrowolleh

var h = "helloworld";

var fz = h.split("");

fz.reverse();

var zh = fz.join("");

console.log(zh);