current position:Home>Please answer the questions about JavaScript!

Please answer the questions about JavaScript!

2022-02-02 19:50:58 CSDN Q & A

img




Refer to the answer 1:

Give you some ideas , If helpful, please click to adopt

for (var i =0;  i < arr.length; i++) {         if(i<n){             arr[arr.length-n+i]=arr[i]          }         else  {             arr[i-n]=arr[i]          }     }



Refer to the answer 2:



Refer to the answer 3:

img




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021950565447.html

Random recommended