I have a big JSON file that I want to intercept all the values that have the key `text` associated with them, for example:

```
    type":"doc",
   "content":[
      {
         "type":"paragraph",
         "content":[
            {
               "text":"this is a simple page, about a simple umbrella.",
               "type":"text"
            }
         ]
      },
      {
         "type":"paragraph",
         "content":[
            {
               "text":"you can use this text to find the umbrella page.",
               "type":"text"
            }
         ]
      },
      {
         "type":"paragraph",
         "content":[
            {
               "text":"do you like it?",
               "type":"text"
            }
         ]
      },

```

I know I can use `Object.keys` but that only covers the "top level" and doesn't go deeper.

I don't wish to use recursion for this, but use an iterative function.

I tried to use `JSON.stringify` but it has poor performance:

```
const obj = JSON.parse(content);
let ret = '';
JSON.stringify(obj, (_, nested) => {
  if (nested && nested[key]) {
    ret += nested[key] + '\n';
  }
  return nested;
});

```