JS Stack Array rückwärts
let arr = [1, 2, 3];
arr.slice().reverse().forEach(x => console.log(x))
Run code snippet
Roaming Coder
let arr = [1, 2, 3];
arr.slice().reverse().forEach(x => console.log(x))
Run code snippet
function PopulateArrayDown() {
//Declare an empty array and its size
var myArray = [];
myArray.length = 10;
//Get last index
var lastElement =myArray.length;
//Create array of data
var Data = [1, 2, 3, 4, 5];
//For each value in data, add it to last position in myArray
$.each(Data, function (lastElement, value) {
myArray.push(lastElement, value);
lastElement -1;
});