数组交换位置

// 数组交换位置
    arrayElemSwapPosition (arr, indexA, indexB) {
      var $this = thisarr.splice(indexA, 1, ...arr.splice(indexB, 1, arr[indexA]))
console.log(arr) }

猜你喜欢

转载自www.cnblogs.com/vae860514/p/11586312.html