---
title: "Loop through an Array with jQuery foreach"  
description: "Loop through an Array with jQuery foreach"  
author: "Anonymous User"  
published: 2018-03-19  
updated: 2018-03-19  
canonical: https://www.mindstick.com/forum/34442/loop-through-an-array-with-jquery-foreach  
category: "jquery"  
tags: ["jquery"]  
reading_time: 1 minute  

---

# Loop through an Array with jQuery foreach

I have an [array](https://www.mindstick.com/articles/335/jagged-array-in-c-sharp-dot-net) in jquery i want to [print](https://www.mindstick.com/blog/301752/types-of-3d-printing-technology) these [elements using jquery](https://www.mindstick.com/forum/158688/how-can-you-dynamically-create-html-elements-using-jquery) each funtion

```
$(function () {
    var myArray = ["one", "two", "three", "four", "five"];

});
```

thanks in advance...

## Replies

### Reply by Anonymous User

try this..

```
$(function () {
    var myArray = ["one", "two", "three", "four", "five"];
    $.each(myArray, function (index, value) {
        console.log(value);
    });
});
```

hope it helps you..


---

Original Source: https://www.mindstick.com/forum/34442/loop-through-an-array-with-jquery-foreach

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
