Skip to content

Soup.shift()

github-actions[bot] edited this page Sep 30, 2024 · 2 revisions

removes the first entry
type: Function

alt names:

  • unpull()

arguments:

  • ?offset Number
    optional offset from the first index

list: pair:
const { Soup } = require('stews');


let arr = new Soup([ "e", "a", "d", "b", "c" ]);


arr.shift(); // removes "e"
arr.shift(1); // removes "d"


console.log(arr);
const { Soup } = require('stews');


let obj = new Soup({ e: 5, a: 1, d: 4, b: 2, c: 3 });


obj.shift(); // removes e
obj.shift(1); // removes d


console.log(obj);
Soup(3) [ "a", "b", "c" ]
Soup(3) { a: 1, b: 2, c: 3 }


Stews Docs 🍲

🛈 Stew 🛈 Soup
🛈 Noodle 🛈 random

Clone this wiki locally