JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>q</title>
<script>
var p=[];
for(var i=0; i<5; i++){
p[i]=[];
}
var temp=[];
function vrotebal(){
temp[0]=Math.floor(Math.random()*100);
temp[1]=Math.floor(Math.random()*100);
temp[2]=Math.floor(Math.random()*100);
for(var i=4; i>0; i--){
p[i]=p[i-1]; //в p[4] записали хуйню из p[3], в p[3] - из p[2], p[2]=p[1], p[1]=p[0]
}
p[0]=temp; //а в p[0] запердолили новый temp с НОВЫМ рандомом.
console.log('-----------------------------');
console.log('p0->', p[0].join(', '));
console.log('p1->', p[1].join(', '));
console.log('p2->', p[2].join(', '));
console.log('p3->', p[3].join(', '));
console.log('p4->', p[4].join(', '));
}
</script>
</head>
<body>
<input id="hello2" type="submit" value="hello" onmousedown="vrotebal();" style="background:#00FF00" />
</body>
</html>