You need to move the num array outside of the function as follows:
var num;
function getnum(){
num = [];
num.push(prompt(enter 3 numbers));
document.write (num); // this prints out.
};
document.write (num); // now it works!
I guess num is declared inside the function getnum and not accessible for document?
var num=[]; //move here
function getnum(){
num.push(prompt(enter 3 numbers));
document.write (num); // this prints out.
};
document.write (num);// i cannot access this array