I Can print Object/Arrays from php into Console and than access its sub objects.
For example I've some array in php
<?php
$arr = Array('name'=>'sajjad','age'=>'20','sex'=>'m');
$json = json_encode($arr);
?>
<script>
console.log(<?php echo $json; ?>);
</script>
I will get following lines as object in chrome console.log.
Object {name: "sajjad", age: "20", sex: "m"}
Suppose i'm not working on backend, how can i access to the subobjects of this object in chrome console panel. like..
For example if I type
>object.name
( and hit enter , console should return me)
>sajjad
or If I type in console
>object.age
>20
or
>object.sex
>m
Thanks ... For understanding. please see pic one. what i want.