Ok i have little section of javascript syntax and i am very confuse how null behaves. There is a lot of discussion about null values but i cant seem to figure out the problem! Please help me. Here is the script.
var jsonData = '<?php echo $jsonData;?>';
if (jsonData)
{
console.log('jsonData is '+ jsonData);// null or not this section is always executed! why?
}else{
ini(jsonData);
}
I tried using '===', '!' operators but still not working as expected
<?php ?>tags are wrapped inquote..returned value will always be string like'null'which istruthyvalue..console.log('hi'); => hinot"hi"..