Array.prototype.pop() by JavaScript convention.
let fruit = ['apple', 'orange', 'banana', 'tomato'];
let popped = fruit.pop();
console.log(popped); // "tomato"
console.log(fruit); // ["apple", "orange", "banana"]
More Related Contents:
- javascript slice without using built in method [closed]
- Fastest way to duplicate an array in JavaScript – slice vs. ‘for’ loop
- How to get first N number of elements from an array
- Explanation of [].slice.call in javascript?
- Does Javascript slice method return a shallow copy?
- How can I create a two dimensional array in JavaScript?
- Find a value in an array of objects in Javascript [duplicate]
- Javascript Array.sort implementation?
- How to convert uint8 Array to base64 Encoded String?
- How to sort numbers correctly with Array.sort()? [duplicate]
- Why do empty JavaScript arrays evaluate to true in conditional structures?
- Sort Array by ISO 8601 date
- Javascript – convert array of arrays into array of objects with prefilled values
- How to combine an array in javascript
- How do I remove an object from an array with JavaScript? [duplicate]
- How to check if array is empty or does not exist? [duplicate]
- How to check whether multiple values exist within an Javascript array
- Converting JSON object to CSV format in JavaScript
- Importing data from multiple csv files in D3
- Convert string array to array in javascript
- Converting an array to a function arguments list [duplicate]
- jQuery UI autocomplete with item and id
- Javascript Set vs. Array performance
- Generate permutations of JavaScript array [duplicate]
- How to search for a string inside an array of strings
- Populate nested object from array?
- What is the concept of Array.map?
- How to correctly use axios params with arrays
- Determining whether one array contains the contents of another array in JavaScript/CoffeeScript
- Group and count values in an array