# Global.get() behavior: intended behavior or bug?

**URL:** <https://discourse.nodered.org/t/global-get-behavior-intended-behavior-or-bug/13971>\
**Category:** General\
**Created:** [3 August 2019 22:29 UTC](https://discourse.nodered.org/t/global-get-behavior-intended-behavior-or-bug/13971 "2019-08-03T22:29:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thatcadguy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thatcadguy/32/5273_2.png) [@thatcadguy](https://discourse.nodered.org/u/thatcadguy)\
**Post date:** [3 August 2019 22:29 UTC](https://discourse.nodered.org/t/global-get-behavior-intended-behavior-or-bug/13971/1 "2019-08-03T22:29:23Z")

</div>

Noticed something peculiar while coding a project this week...some unexpected behavior that took me an embarrassingly long time to figure out.

```auto
var a = global.get('this_doesnt_exist'); // returns null as it is doesn't exist, no error thrown

var a = global.get('this_doesnt_exist.something'); // object member access: still returns null as it is doesn't exist, no error thrown

var a = global.get(['this_doesnt_exist']); // returns [null] as it is doesn't exist, no error thrown

var a = global.get(['this_doesnt_exist.something']); // "ReferenceError: value is not defined"

```

I would expect the last line to return Array size of 1, containing null, similar to line #2. Is this intended or a bug? Thanks in advance.

---

<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:** [3 August 2019 22:39 UTC](https://discourse.nodered.org/t/global-get-behavior-intended-behavior-or-bug/13971/2 "2019-08-03T22:39:24Z")

</div>

Bug - it should be consistent in behaviour. Please raise an issue on GitHub if you're able to.

---

<div class="post-metadata">

**Author:** ![thatcadguy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thatcadguy/32/5273_2.png) [@thatcadguy](https://discourse.nodered.org/u/thatcadguy)\
**Post date:** [3 August 2019 22:50 UTC](https://discourse.nodered.org/t/global-get-behavior-intended-behavior-or-bug/13971/3 "2019-08-03T22:50:07Z")

</div>

Thanks @knolleary, done. [https://github.com/node-red/node-red/issues/2252](https://github.com/node-red/node-red/issues/2252)
