# Syntax error: Unexpected token 'return'

**URL:** <https://discourse.nodered.org/t/syntax-error-unexpected-token-return/69737>\
**Category:** General\
**Tags:** function-node\
**Created:** [28 October 2022 13:03 UTC](https://discourse.nodered.org/t/syntax-error-unexpected-token-return/69737 "2022-10-28T13:03:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvconsan](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@alvconsan](https://discourse.nodered.org/u/alvconsan)\
**Post date:** [28 October 2022 13:03 UTC](https://discourse.nodered.org/t/syntax-error-unexpected-token-return/69737/1 "2022-10-28T13:03:07Z")

</div>

Morning,  
Im new with Node-Red (I program to survive...) I need some help with this trubble..I not sure where is the problem, I think it is related to "if" sequence because I have "Debuged" the rest and seems to be OK.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/b/7b77047765209038c702f963e96caa23521c7dee.png)  
Node-RED version: v2.1.3  
Node.js version: v16.13.0  
Thank you!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 October 2022 13:15 UTC](https://discourse.nodered.org/t/syntax-error-unexpected-token-return/69737/2 "2022-10-28T13:15:23Z")

</div>

Hi @alvconsan

For future reference, it is much easier to help debug code if you provide the code itself rather than a screenshot.

That said, I can see you have an extra `}` on line 9 that should be deleted.

---

<div class="post-metadata">

**Author:** ![alvconsan](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@alvconsan](https://discourse.nodered.org/u/alvconsan)\
**Post date:** [2 November 2022 07:31 UTC](https://discourse.nodered.org/t/syntax-error-unexpected-token-return/69737/3 "2022-11-02T07:31:15Z")

</div>

uh...it is true.  
Ok, nice advise!  
thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 January 2023 07:31 UTC](https://discourse.nodered.org/t/syntax-error-unexpected-token-return/69737/4 "2023-01-01T07:31:37Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
