Skip to content

Soup.get()

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

gets an entry by index or key
type: Function

works the same as:

Soup[entry];
Soup.key

alt names:

  • at()

arguments:

  • entry Any:
    index or key to get

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


let arr = new Soup([ "val1", "val2" ]);


console.log(arr.get("val1"));
console.log(arr.get(0));


// these work the same
arr["val1"];
arr[0];
const { Soup } = require('stews');


let obj = new Soup({ key1: "val1" });


console.log(obj.get("key1"));
console.log(obj.get(0));


// these work the same
obj["key1"];
obj[0];
"val1" // get by key
"val1" // get by index
"val1" // get by key
"val1" // get by index


Stews Docs 🍲

🛈 Stew 🛈 Soup
🛈 Noodle 🛈 random

Clone this wiki locally