+ 4
Could someone explain me how this code works line to line? Thanks.
var x=[1,2,3,4,5]; for(var i=0;i<4;i++){ x[i]=x[i+1]; if(i==x.length-2){ x[i]=x[0]; } } document.write(x)
3 ответов
+ 6
nitish Hahaha... I am on mobile but it has a large screen so it is not too bad ☺
+ 4
thanks for all comments
+ 2
Go the JS tab and read the comments.
https://code.sololearn.com/WYNeQHDi0D0Q/?ref=app