Skip to content

Soup.startsWith()

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

checks if it starts with stuff
type: Function

arguments:

  • ?values Any
    list of values (array or arguments) to check for
    if one of them is true it'll return true

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


let arr = new Soup([ "abc", "def" ]);


// false because it doesn't start with that
console.log(arr.startsWith("bc"));


// true because it does start with it
console.log(arr.startsWith("abc"));


// true because it does start with one of them
console.log(arr.startsWith("bc", "abc"));
const { Soup } = require('stews');


let obj = new Soup({ abc: 0, def: 1 });


/// false because it doesn't start with that
console.log(obj.startsWith("bc"));


// true because it does start with it
console.log(obj.startsWith("abc"));


// true because it does start with one of them
console.log(obj.startsWith("bc", "abc"));
false
true
true
false
true
true


Stews Docs 🍲

🛈 Stew 🛈 Soup
🛈 Noodle 🛈 random

Clone this wiki locally