# Total of array, but not .length!

**URL:** https://forum.kirupa.com/t/total-of-array-but-not-length/246493
**Category:** Uncategorized
**Created:** [December 11, 2007, 5:02pm UTC](https://forum.kirupa.com/t/total-of-array-but-not-length/246493 "2007-12-11T17:02:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ubermeowmix](https://avatars.discourse-cdn.com/v4/letter/u/7cd45c/32.png) [@Ubermeowmix](https://forum.kirupa.com/u/Ubermeowmix)
#### Post date: [December 11, 2007, 5:02pm UTC](https://forum.kirupa.com/t/total-of-array-but-not-length/246493/1 "2007-12-11T17:02:58Z")

</div>

I don’t need the length of an array, I need the total number of cells that contain something.

How would I go about this, the for loop I am using to check the array is not working, it’s just evaluating to the max number:

for (var i=0;i\<8;i++){  
if (namesArray\* != “”){  
newNames++;  
}  
}

```auto
Life is like super Mario, nobody wants to be luigi :luigi:

```
