Okay, I'm just doing a function that moves everything from one list to another, and as soon as that's finished, it spontaneously becomes undefined. There is no good reason for it to do that but what's the bad reason?
Here, look,
function moveList(){//in my real program it actually shuffles the list, this one just transfers the contents
var listOne=[0, 1, 2, 3];//we have a list
var listTwo=[];//now we have an empty list
var length = listOne.length//and now we have the list length
for (run = 0; run < length; run++) {
listTwo.push(listOne[0]);//it just copies the first entry from the first list to the second
listOne.splice(0, 1,)//and deletes it from the first list
}//this does it for an entry in the list, it's length amount of times
console.log("listTwo: " + listTwo);//this tells us what the new list now is, and it works
console.log("listOne: " + listOne);//this tells us what the original list is, which is empty
}
var listOne;
var listTwo;
//these are mandatory, without this, even with the function below script,
//you have Uncaught ReferenceError: list(One and Two) is not defined
moveList();//now we do the function, and then,
console.log("listTwo: " + listTwo);//THE LIST IS NOW UNDEFINED??? What??????
Just why? I literally just defined it in my function. What's wrong with you (literally, I don't see)?