I have 2 php variables in PHP (mainly $usm and $ag) and am passing them to the frontend. In Javascript am using isset to check if they have a value before executing some code but seems not to work
<script>
if( <?php isset($usm , $ag) ?> ){
$( document ).ready(function() {
var usmData = {!! json_encode($usm) !!};
var agData = {!! json_encode($ag) !!};
});
}
</script