# Function node: 'use strict'

**URL:** <https://discourse.nodered.org/t/function-node-use-strict/6152>\
**Category:** General\
**Created:** [27 December 2018 07:10 UTC](https://discourse.nodered.org/t/function-node-use-strict/6152 "2018-12-27T07:10:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sineos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sineos/32/3440_2.png) [@Sineos](https://discourse.nodered.org/u/Sineos)\
**Post date:** [27 December 2018 07:10 UTC](https://discourse.nodered.org/t/function-node-use-strict/6152/1 "2018-12-27T07:10:26Z")

</div>

Does it make sense / is it recommended to put a `use strict` on top of a function node?  
When doing so, I get a lot of warnings because of not defined variables like `msg`, `flow` etc.

---

<div class="post-metadata">

**Author:** ![WillWelker](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/willwelker/32/771_2.png) [@WillWelker](https://discourse.nodered.org/u/WillWelker)\
**Post date:** [27 December 2018 08:36 UTC](https://discourse.nodered.org/t/function-node-use-strict/6152/2 "2018-12-27T08:36:43Z")

</div>

I don't think it is intended for you to `use strict` in the function nodes.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [27 December 2018 14:05 UTC](https://discourse.nodered.org/t/function-node-use-strict/6152/3 "2018-12-27T14:05:29Z")

</div>

You don't really need to since function nodes run in a Node.JS VM anyway. I don't think it will help. However, it won't do any harm either.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 December 2018 15:19 UTC](https://discourse.nodered.org/t/function-node-use-strict/6152/4 "2018-12-27T15:19:18Z")

</div>

Well.... It will do harm in that it will trigger all those warnings and cause concern for the user. So better not to use it inside a function node.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [27 December 2018 15:55 UTC](https://discourse.nodered.org/t/function-node-use-strict/6152/5 "2018-12-27T15:55:29Z")

</div>

> [@dceejay](#):
>
> It will do harm in that it will trigger all those warnings

Oops, sorry yes. Missed that. You are right as always.
