ulricht609 Thanks for jumping in, looks like I need an if else statement on the length of products. The push works because I checked the length by adding onclick to button that alerts products length. unfortunatley
alert(products.slice(-1) + ' : products.slice(-1)'); // returns undefined in the prompt when products length is 1
//Which is wierd as products length 1 actualy means two 0 & 1 ?
Will try it again but I'm pritty sure I've seen a function that querys the length of an array before it uses slice[-1]:x
Actually I was wrong, that is the correct syntax, this works and I can't thank you enough. Muchos Mas Gracias!
viewcart() that works
prompt('You need to return to product page: ',products.slice(-1));//returns 'silver' in prompt box
//the exact affect I wanted. I thought I had tried it but must have done it wrong
//the products length doesn't have to be longer than 1 or element 0 of the array
//which is actually alert as length returning '1'?
Now I have to create a pseudo prompt which changes the innerHTML of 'f1' and gets the slice[-1] value just like the prompt input does. Then when the client clicks the OK./Return button I can apply the onclick calling the the original function with the value in that input?