📜  js 反向 - Javascript 代码示例

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

代码示例6
const array1 = ['one', 'two', 'three'];
console.log('array1:', array1);
//["one", "two", "three"]

const reversed = array1.reverse();
console.log('reversed:', reversed);
//["three", "two", "one"]

// Careful: reverse is destructive -- it changes the original array.
console.log('array1:', array1);
//["three", "two", "one"]