Function Node: Turn a list of items into an array of items using push

Hi N8N’rs!

I have a Function node challenge.

I have an list of items, with fields that has no JSON parent.

I would like to put each of the items under a parent item “cells”

So current simple structure is:

{
“key” : “value”,
“key2” : “value”
},
{
“key” : “value”,
“key2” : “value”
},
etc…

Want to make it so the items are an array under the key “cells”:

{
“cells” : [
{
“key” : “value”,
“key2” : “value”
},
{
“key” : “value”,
“key2” : “value”
},
]}

I’m having trouble working out the function node logic to nail this. I know it’s probably fairly simple…

Thanks for any help,

The function node should look something like:

const data = items.map((item) => item.json);

return [
  {
    json: {
      cells: data
    }
  }
]
Example workflow