Node.js pop() function Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report pop() is an array function from Node.js that is used to remove elements from the end of an array. Syntax: array_name.pop() Parameter: This function does not take any parameter. Return type: The function returns the array. The program below demonstrates the working of the function: Example 1: javascript function POP() { arr.pop(); console.log(arr); } const arr = [1, 2, 3, 4, 5, 6, 7]; POP(); Output: [ 1, 2, 3, 4, 5, 6 ] Example 2: javascript function POP() { arr.pop(); console.log(arr); } const arr = ['GFG']; POP(); Output: [] Example 3: javascript const Lang = ['java', 'c', 'python']; console.log(Lang); // expected output: Array [ 'java', 'c', 'python' ] Lang.pop(); console.log(Lang); // expected output: Array [ 'java', 'c' ] Output: [ 'java', 'c', 'python' ] [ 'java', 'c' ] Comment More infoAdvertise with us Next Article Collect.js pop() Method T Twinkl Bajaj Follow Improve Article Tags : Web Technologies Node.js NodeJS-function Similar Reads Node.js push() function push() is an array function from Node.js that is used to add elements to the end of an array. Syntax:array_name.push(element)Parameter: This function takes a parameter that has to be added to the array. It can take multiple elements also. Return type: The function returns the array after adding the 1 min read Node.js push() function push() is an array function from Node.js that is used to add elements to the end of an array. Syntax:array_name.push(element)Parameter: This function takes a parameter that has to be added to the array. It can take multiple elements also. Return type: The function returns the array after adding the 1 min read Essence of Node.js Node.js or Node has a small core group of modules, commonly referred to as the Node Core that is exposed as the public Node API by using we write our applications or we can say that the Node Core implements the public Node API. Some examples of the modules present in the node core are: To work with 8 min read Essence of Node.js Node.js or Node has a small core group of modules, commonly referred to as the Node Core that is exposed as the public Node API by using we write our applications or we can say that the Node Core implements the public Node API. Some examples of the modules present in the node core are: To work with 8 min read Collect.js pop() Method The pop() method is used to remove the last element from collection and returns the popped element. Syntax: collect(array).pop() Parameters: The collect() method takes one argument that is converted into the collection and then pop() method is applied on it. Return Value: This method returns the pop 1 min read Node.js Events An event in NodeJS is an action or occurrence, such as a user click, a file being read, or a message being received, that NodeJS can respond to. Events are managed using the EventEmitter class, which is part of NodeJS's built-in events module. This allows NodeJS to react to various actions asynchron 7 min read Like