Question: I'm getting this string. (I'm getting Comma Separated Character String from Backend)

```
"seasons": "[7, 9]"

```

I want to iterate the array of Array like this. 

```
// example
this.props.data.seasons.map((element) => console.log(element));

```

How do we convert "[7, 9]" to Array [7, 9]? 

Is it usual for you guys to handle array string?

Answer: 
Use `[JSON.parse](https://www.w3schools.com/js/js_json_parse.asp)` to convert JavaScript object.

```
const tempDict = {"seasons": "[7, 9]"}
JSON.parse(tempDict.seasons)

```
Use `JSON.parse(element)`:

```
let newArray = JSON.parse(this.props.data.seasons);
console.log(newArray[0]);  //printing 7, ryt ?

```

See [`JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)