Question:Briefly describe JavaScript core Array method pop() with an example.
Answer
Array.pop() method removes the last element of an array and returns it.Example:var stackWork=new Array("Lenny","Harold","Mary","Jean","Sal");
var item=stackWork.pop();
document.write(item);
document.write("<br/>")
document.write(stackWork);Output:
Sal
Lenny,Harold,Mary,Jean