If I have an array of words...

```
const a = ["abc", "abcd", "xyz"]

```

and I want to sort that array and filter it based off a pattern (ex. "ab") then I can use filter and regex like so... [giving me the array of items which has "ab" at the start of every item in the array"

```
let value = "abc";
let regex = new RegExp(`^${value}`, `i`);
const sorted = a.sort().filter(v => regex.test(v));

```

However, what about this same principle, but instead of an array of items, those items are objects within an array, like so...

```
const b = [
{text: "abc", color: "blue"},
{text: "abcd", color: "red"},
{text: "xyz", color: "yellow"}
]

```