# Traversing elements inside an array which is inside another array in p5js

**URL:** <https://discourse.processing.org/t/traversing-elements-inside-an-array-which-is-inside-another-array-in-p5js/36923>\
**Category:** Beginners\
**Tags:** homework\
**Created:** [May 17, 2022, 2:29pm UTC](https://discourse.processing.org/t/traversing-elements-inside-an-array-which-is-inside-another-array-in-p5js/36923 "2022-05-17T14:29:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lvndr](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@lvndr](https://discourse.processing.org/u/lvndr)\
**Post date:** [May 17, 2022, 2:29pm UTC](https://discourse.processing.org/t/traversing-elements-inside-an-array-which-is-inside-another-array-in-p5js/36923/1 "2022-05-17T14:29:45Z")

</div>

Is there a way in p5js to traverse elements inside an array that is inside another array?

 ![Screenshot (26)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/9/79ff34ed6353a11d3d4e5c292de81cfa2415c929.png)  
This is the CSV file I am using, and I want to access the elements inside the ingredients column one by one. Since each row has a list of its own how do I access the elements one by one in that list?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [May 17, 2022, 8:32pm UTC](https://discourse.processing.org/t/traversing-elements-inside-an-array-which-is-inside-another-array-in-p5js/36923/2 "2022-05-17T20:32:28Z")

</div>

> [@lvndr](#):
>
> , and I want to access the elements inside the ingredients column one by one.

From the PoV of a CSV file each column’s element is a single string object.  
However you can turn a string into a string array by using **split()** or [**splitTokens()**](https://p5js.org/reference/#/p5/splitTokens):  
`const ingredients = splitTokens(ingredientsColumn, ', ');`
