# Cannot read property 'map' of undefined

**URL:** <https://community.synatic.com/t/cannot-read-property-map-of-undefined/65>\
**Category:** Calculators\
**Tags:** calculator, javascript\
**Created:** [March 5, 2021, 12:06pm UTC](https://community.synatic.com/t/cannot-read-property-map-of-undefined/65 "2021-03-05T12:06:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaun](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.synatic.com/shaun/32/7_2.png) [@shaun](https://community.synatic.com/u/shaun)\
**Post date:** [March 5, 2021, 12:06pm UTC](https://community.synatic.com/t/cannot-read-property-map-of-undefined/65/1 "2021-03-05T12:06:12Z")

</div>

If you see the error “Cannot read property ‘map’ of undefined”, it implies you are trying to map to a empty array or set of values.

Typically, the javascript code within the calculator will appear as below:

_inputRecord.ArrayList.map(item =\> ({_

- key: item.ArrayKey,\*
- value: item.ArrayValue\*  
_})),_

Making use of Javascript Truthy logic, you can handle an empty (null) array as below:

_**(inputRecord.ArrayList||[])**.map(item =\> ({_

- key: item.ArrayKey,\*
- value: item.ArrayValue\*  
_})),_
