JavaScript Array pop() methodThe JavaScript array pop() method removes the last element from the given array and return that element. This method changes the length of the original array. SyntaxThe pop() method is represented by the following syntax: ReturnThe last element of given array. JavaScript Array pop() method exampleLet's see some examples of pop() method. Example 1Here, we will pop an element from the given array. Test it NowOutput: Orginal array: AngularJS,Node.js,JQuery Extracted element: JQuery Remaining elements: AngulaJS,Node.js Example 2In this example, we will pop all the elements from the given array. Test it NowOutput: Extracted element: JQuery Extracted element: Node.js Extracted element: AngulaJS Next TopicJavaScript Array |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India