I want to pass php array in javascript code . when i use like this:

```
var resData = "{{ json_encode($data['calendarItems']) }}";

```

or this : 

```
 var resData = "{{ $data['calendarItems'] }}";

```

in both the result is : 

```
[{&quot;title&quot;:&quot;rfvd vc&quot;,&quot;expired_at&quot;:&quot;2018-12-31 00:00:00&quot;}] //formatting

```

and JSON.parse return error. I can not get the array