This is my ajax code, I need to check whether json data has an array or not? How can I? I have tried this but yet it shows me wrong output.
$.ajax({
url: url,
type: 'POST',
data: {'data': data},
dataType: "json",
success: function (data) {
if(data)
{
console.log('data is there');
}
else
{
console.log('data is not there');
}
This is response I am giving in return to ajax.
<?php
$json_data_array = '[]';
return $json_data_array;
?>
How can I check?