# JS Syntax Help

**URL:** <https://community.n8n.io/t/js-syntax-help/15377>\
**Category:** Questions\
**Created:** [July 1, 2022, 7:15am UTC](https://community.n8n.io/t/js-syntax-help/15377 "2022-07-01T07:15:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coachmikemonte](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/coachmikemonte/32/12635_2.png) [@coachmikemonte](https://community.n8n.io/u/coachmikemonte)\
**Post date:** [July 1, 2022, 7:15am UTC](https://community.n8n.io/t/js-syntax-help/15377/1 "2022-07-01T07:15:43Z")

</div>

{{$node[“aggregateCoachRows”].json[“id”].some(id=\> id === $node[“iterateTrainers”].json[“id”])}}

Why would this give me this error: [invalid (Expression is not valid: Malformed arrow function parameter list)] (edited)

This is an array: $node[“aggregateCoachRows”].json[“id”].

This is an INT $node[“iterateTrainers”].json[“id”]

## What is the error message (if any)?

{  
“nodes”: [  
{  
“parameters”: {  
“httpMethod”: “POST”,  
“path”: “c8b8aaac-0025-4cd2-b779-470a7eb16e6e”,  
“options”: {}  
},  
“name”: “Webhook”,  
“type”: “n8n-nodes-base.webhook”,  
“typeVersion”: 1,  
“position”: [  
-380,  
340  
],  
“webhookId”: “c8b8aaac-0025-4cd2-b779-470a7eb16e6e”  
},  
{  
“parameters”: {  
“authentication”: “genericCredentialType”,  
“genericAuthType”: “httpBasicAuth”,  
“requestMethod”: “POST”,  
“url”: “[https://api.trainerize.com/v03/user/getTrainerList](https://api.trainerize.com/v03/user/getTrainerList)”,  
“jsonParameters”: true,  
“options”: {},  
“bodyParametersJson”: “={\n "sort": "name",\n "start": 0,\n "count": 100\n}”  
},  
“name”: “getTrainerList”,  
“type”: “n8n-nodes-base.httpRequest”,  
“typeVersion”: 2,  
“position”: [  
80,  
340  
],  
“credentials”: {  
“httpBasicAuth”: {  
“id”: “22”,  
“name”: “54D Trainerize Connection”  
}  
}  
},  
{  
“parameters”: {  
“fieldToSplitOut”: “users”,  
“options”: {}  
},  
“name”: “iterateTrainers”,  
“type”: “n8n-nodes-base.itemLists”,  
“typeVersion”: 1,  
“position”: [  
240,  
340  
]  
},  
{  
“parameters”: {  
“conditions”: {  
“boolean”: [  
{  
“value1”: “={{$node["aggregateCoachRows"].json["id"].some(id=\> id === $node["iterateTrainers"].json["id"])}}”  
}  
]  
}  
},  
“name”: “IF”,  
“type”: “n8n-nodes-base.if”,  
“typeVersion”: 1,  
“position”: [  
400,  
340  
]  
},  
{  
“parameters”: {  
“operation”: “executeQuery”,  
“query”: “SELECT \* FROM coaches;”  
},  
“name”: “queryCoachTable”,  
“type”: “n8n-nodes-base.mySql”,  
“typeVersion”: 1,  
“position”: [  
-220,  
340  
],  
“credentials”: {  
“mySql”: {  
“id”: “25”,  
“name”: “[apps.fitnessmarketingmachine.net](http://apps.fitnessmarketingmachine.net)”  
}  
}  
},  
{  
“parameters”: {  
“operation”: “aggregateItems”,  
“fieldsToAggregate”: {  
“fieldToAggregate”: [  
{  
“fieldToAggregate”: “id”  
}  
]  
},  
“options”: {}  
},  
“name”: “aggregateCoachRows”,  
“type”: “n8n-nodes-base.itemLists”,  
“typeVersion”: 1,  
“position”: [  
-80,  
340  
]  
}  
],  
“connections”: {  
“Webhook”: {  
“main”: [  
[  
{  
“node”: “queryCoachTable”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“getTrainerList”: {  
“main”: [  
[  
{  
“node”: “iterateTrainers”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“iterateTrainers”: {  
“main”: [  
[  
{  
“node”: “IF”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“queryCoachTable”: {  
“main”: [  
[  
{  
“node”: “aggregateCoachRows”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“aggregateCoachRows”: {  
“main”: [  
[  
{  
“node”: “getTrainerList”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
}  
}  
}

```auto

## Share the output returned by the last node
<!-- If you need help with transforming the data, please also share the expected output -->

## Information on your n8n setup
- **n8n version:**
- **Database you're using (default: SQLite):**
- **Running n8n with the execution process [own(default), main]:**
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:**
```

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [July 1, 2022, 7:22am UTC](https://community.n8n.io/t/js-syntax-help/15377/2 "2022-07-01T07:22:48Z")

</div>

Hi @coachmikemonte

Welcome to the community!

I cannot copy your workflow into my environment. I guess something got messed up when you posted it.  
Could you try inserting it in a preformatted text (the \</\> option)

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 1, 2022, 9:08am UTC](https://community.n8n.io/t/js-syntax-help/15377/3 "2022-07-01T09:08:10Z")

</div>

Hey @coachmikemonte,

From what I have seen the expressions don’t support arrow functions, For small bits of javascript they are all good but if you wanted something more you would need to use a function node.
