How to get the number of elements in an array? I mean array size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2018 03:16 AM
Hi All,
I am using arrayName.length to get the number of elements in an array.
But result not seems right.
What is the best way to get the count of the array elements?
Is there anyother method?
Thanks & Regards,
Ram Prakash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2018 03:18 AM
Hi,
How are you pushing elements in this array first let me know that.
We use arrayName.length only to check its length.
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2018 03:23 AM
Hi Ashutosh,
It is list collector variable where we can select multiple values from left hand side to right hand side.
I am getting the selected values in an array and want to find its length. But somehow the method "length" not seems to be working. Instance is in Jakarta version.
what is the next best way to find the array length?
Thanks & Regards,
Ram Prakash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2018 03:44 AM
HI,
Ohk do one thing.
Split it by ','
var abc = arrayName.split(',');
var len = abc.length;
Or will pushing the details to array use .toString and then use arrayName.length
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2018 03:19 AM
Try using arrayname.toString().length;