Example 1: removing first item array js
var list = ["bar", "baz", "foo", "qux"]; list.shift()
Example 2: javascript remove last element from array
array.pop(); var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.pop();
Example 3: javascript remove last element from array
var colors = ["red","blue","green"]; colors.pop();
Example 4: how to remove last element in js
var array = [1, 2, 3, 4, 5, 6]; array.pop(); console.log(array);
Example 5: js array pop
var array = ['A', 'B', 'C']; lastElement = array.pop();
Example 6: método pop javascript
const cars = ['Porsche', 'Ferrari', 'Mustang', 'Rolls Royce', 'Lamborghini']; console.log(cars.pop()); console.log(cars);
Comments
Post a Comment