# validating an object inside an array

**URL:** https://forum.servoy.com/t/validating-an-object-inside-an-array/2510
**Category:** Classic Servoy
**Created:** [August 19, 2004, 4:58pm UTC](https://forum.servoy.com/t/validating-an-object-inside-an-array/2510 "2004-08-19T16:58:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Christoph](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Christoph](https://forum.servoy.com/u/Christoph)
#### Post date: [August 19, 2004, 4:58pm UTC](https://forum.servoy.com/t/validating-an-object-inside-an-array/2510/1 "2004-08-19T16:58:50Z")

</div>

Hello, I have a JavaScript question:

I have an object at certain positions of an Array and need to test if a position contains that object. If I do

````auto
if (anArray*[j])*
*```*
*I get an error "the undefined value has no properties" if there really is an object. If there is no object (array position is undefined) it passes OK.* 
*Does anyone know how to test for the existence of an object?*
*Thanks*
````

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [August 20, 2004, 10:46am UTC](https://forum.servoy.com/t/validating-an-object-inside-an-array/2510/2 "2004-08-20T10:46:38Z")

</div>

just out of my head  
what does this:

````auto
if(anArray && anArray _&& anArray*[j])*_
_*```*_
````
