var lucky = ["11", "25", "33", "42", "57"];
var rand = Math.floor(Math.random() * 26) + 1;
Use Push() Method To Add Final Number *
Use the push method to add the final number to the array. This will be a number auto generated 1-26. Here is the syntax.
You can use the join method to input something between each data item in your array.
var fruits = ["Tom", "Dick", "Harry"]; var x = document.getElementById("foo") x.innerHTML = fruits.join(" / ");
Use the pop method when you want to remove the last item in the array.
Return Items Poped Out *
There is also a way to return the item that was poped out.
I hope you enjoyed the article. If I was able to help you please consider a tip for the content.
One Time Tip