Skip to content

Stew.push()

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

adds a new entry to the end
type: Function

alt names:

  • push_back()

arguments:

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

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

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

arr.push("c");

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

let obj = new Stew({ key1: "val1", key2: "val2" });

obj.push("key3", "val3");

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


Stews Docs 🍲

🛈 Stew 🛈 Soup
🛈 Noodle 🛈 random

Clone this wiki locally