---
title: "Nested Arrays"  
description: "Nested Arrays"  
author: "Anonymous User"  
published: 2018-07-03  
updated: 2018-07-03  
canonical: https://www.mindstick.com/forum/34570/nested-arrays  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# Nested Arrays

[Nested](https://www.mindstick.com/forum/45/itemcommand-event-in-nested-repeater-and-listview) [Arrays](https://www.mindstick.com/articles/11955/arrays-and-its-limitations) in [JSON](https://www.mindstick.com/forum/34446/convert-json-string-to-object) [Objects](https://www.mindstick.com/forum/145447/what-are-objects) ?

## Replies

### Reply by Prakash nidhi Verma

Arrays as JSON Objects :

JSON array are almost the same as arrays in JS. Values must be string, number, object, array, boolean or null type in JSON array.

Example :

```
[ "Allahabad", "Kanpur", "Varansi" ]
```

Array values by using a for-in loop:

```
for (i in myObj.city) {     x += myObj.city[i];
}
```

Nested Arrays in JSON Objects:

```
myObj = {     "name":"Prakash",
    "age":19,
    "city": [
        { "name":"Allahabad", "models":[ "Sangam"] },
        { "name":"Kanpur", "models":[ "Industrial"] },
        { "name":"Varansi", "models":[ "Devnagari" ] }
    ]
 }
```

```
delete myObj.city[1];    //Delete array 
```


---

Original Source: https://www.mindstick.com/forum/34570/nested-arrays

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
