-
Notifications
You must be signed in to change notification settings - Fork 0
Soup.pop()
github-actions[bot] edited this page Sep 30, 2024
·
2 revisions
removes the last entry
type: Function
alt names:
- unpush()
arguments:
- ?offset
Number
optional offset from the last index
list: | pair: |
const { Soup } = require('stews');
let arr = new Soup([ "a", "b", "d", "c", "e" ]);
arr.pop(); // removes "e"
arr.pop(1); // removes "d"
console.log(arr); |
const { Soup } = require('stews');
let obj = new Soup({ a: 1, b: 2, d: 4, c: 3, e: 5 });
obj.pop(); // removes e
obj.pop(1); // removes d
console.log(obj); |
Soup(3) [ "a", "b", "c" ] |
Soup(3) { a: 1, b: 2, c: 3 } |