Hi, the function node needs to contain valid Javascript and if you aren't familiar, there are some excellent short courses and tutorials that will give you the basics and more.
Your post doesn't really contain enough information to help. What you've given is actually valid JSON not JavaScript. JSON is a serialisable data format closely related to but not the same as a JavaScript object.
A typical function node might look like:
return {
"body": msg.payload,
}
Which does very little obviously but does output a new message based on the input message.