# Debug node does not display a property?

**URL:** <https://discourse.nodered.org/t/debug-node-does-not-display-a-property/459>\
**Category:** General\
**Created:** [29 May 2018 03:01 UTC](https://discourse.nodered.org/t/debug-node-does-not-display-a-property/459 "2018-05-29T03:01:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [29 May 2018 03:01 UTC](https://discourse.nodered.org/t/debug-node-does-not-display-a-property/459/1 "2018-05-29T03:01:59Z")

</div>

I wanted to test if Node-Red would accept to pass a function as a property of the msg object and have it executed downstream in the flow. Since a function is an object in JavaScript this should work flawlessly. Well, it indeed did. However I found out that the debug node will not display the function property, not even as an object. I don´t think this is relevant as it is very unlikely that someone using Node-Red will ever pass a function inside a msg object. Just wanted to confirm that this is an expected behavior of the debug node.

This is the msg created for testing. The function was added as property msg.fn

```auto
var bl = true;
var nb = 12;
var st = "Learning Node-Red";
var ar = [2,4,6,8];
var nu = null;
var ob = {"Chapter": "Node-Red basics", lesson: 1};

var fn = function () {
    var mvalue = 3 + 3;
    return mvalue;
};

msg.bl = bl;
msg.nb = nb;
msg.st = st;
msg.ar = ar;
msg.nu = nu;
msg.ob = ob;
msg.fn = fn;

return msg;

```

The flow:

```auto
[{"id":"867979e7.294318","type":"debug","z":"aca1823a.1ad09","name":"Debug Node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":890.1000137329102,"y":167.00000190734863,"wires":[]},{"id":"f28076ee.355b88","type":"inject","z":"aca1823a.1ad09","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":134.10000228881836,"y":166.00000286102295,"wires":[["ca978ff6.64f7a"]]},{"id":"ca978ff6.64f7a","type":"function","z":"aca1823a.1ad09","name":"Modify msg object","func":"var bl = true;\nvar nb = 12;\nvar st = \"Learning Node-Red\";\nvar ar = [2,4,6,8];\nvar nu = null;\nvar ob = {\"Chapter\": \"Node-Red basics\", lesson: 1};\n\nvar fn = function () {\n var mvalue = 3 + 3;\n return mvalue;\n};\n\nmsg.bl = bl;\nmsg.nb = nb;\nmsg.st = st;\nmsg.ar = ar;\nmsg.nu = nu;\nmsg.ob = ob;\nmsg.fn = fn;\n\nreturn msg;","outputs":1,"noerr":0,"x":311.1000518798828,"y":166.00000190734863,"wires":[["5492a727.500ad8"]]},{"id":"5492a727.500ad8","type":"function","z":"aca1823a.1ad09","name":"Display msg.fn","func":"node.warn(\"Coercing to string \" + msg.fn);\nreturn msg;","outputs":1,"noerr":0,"x":519.1000556945801,"y":167.00000190734863,"wires":[["90abfdca.a389f"]]},{"id":"90abfdca.a389f","type":"function","z":"aca1823a.1ad09","name":"Execute msg.fn","func":"var a = msg.fn;\nnode.warn(\"Executing the function, results... \" + a());\nreturn msg;","outputs":1,"noerr":0,"x":713.1000595092773,"y":167.00000190734863,"wires":[["867979e7.294318"]]}]

```

 ![debug-bug-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/60351d4c2947b18efc7e6b82e87f8639d71b28cb.PNG)

The view of the debug side panel. Property msg.fn was not displayed.

 ![debug-bug-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/8fc2de030fb07fe055abb2949a6b6f9f0e76ba17.PNG)

---

<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:** [29 May 2018 06:36 UTC](https://discourse.nodered.org/t/debug-node-does-not-display-a-property/459/2 "2018-05-29T06:36:28Z")

</div>

Strictly speaking it works, but it isn’t a pattern we recommend or advise. Message properties _should_ be json-encodable, which functions are not. The lack of support for functions in the debug sidebar reflects this.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [29 May 2018 16:10 UTC](https://discourse.nodered.org/t/debug-node-does-not-display-a-property/459/3 "2018-05-29T16:10:54Z")

</div>

Fully understand (and agree). Thank you very much indeed.
