简体   繁体   中英

how to get Json format from array

hi i want to convert my array in json format and my current array in this struncture that u cann see below, as well as i am showing structure that i want using javascript.

**current Array Format:

Array[0]
abc: Array[1]
0: "English"
length: 1
abc1: Array[2]
0: "English"
1: "Urdu"
length: 2

strong text i Want json format from current Array Format:**

[
    {
        "abc": [
            {
                "0": "English"
            },
            {
                "1": "Urdu"
            }
        ]
    }
]

Use JSON.stringify(myArray) .

Documentation: http://www.json.org/js.html

DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM