Stew.pull() - shysolocup/stews GitHub Wiki

adds a new entry to the front
type: Function

alt names:

  • push_front()

arguments:

  • key/value Any
    key or value to pull
    for lists you only use the value
  • ?value Any
    optional value to pull
    only used in pairs

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

let arr = new Stew([ "b", "c" ]);

arr.pull("a");

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

let obj = new Stew({ key2: "val2", key3: "val3" });

obj.pull("key1", "val1");

console.log(obj);
Stew(3) [ "a", "b", "c" ]
Stew(3) { key1: "val1", key2: "val2", key3: "val3" }


⚠️ **GitHub.com Fallback** ⚠️