SyntaxFix
Write A Post
Hire A Developer
Questions
console.log(typeof json_data !== 'undefined' ? json_data.length : 'There is no spoon.');
...or more simply...
console.log(json_data ? json_data.length : 'json_data is null or undefined');