I have 2 thoughts on this one… You could use an Item List node and set that to body.content then use an if node after that or in your code node you can use the $input.item.json option which I think is inserted into the node when you first open it so you would want something like…
let ris;
var length = $input.item.json.body.content.length;
for (let i = 0; i < length; i++) {
ris = $input.item.json.body.content[i].type;
}
return { json: { ris } };