I\'m checking if(response[0].title !== undefined), but I get the error:
if(response[0].title !== undefined)
Uncaught TypeError: Cannot read property \'title\' of undefined.<
Actually you must surround it with an Try/Catch block so your code won't stop from working. Like this:
try{ if(typeof response[0].title !== 'undefined') { doSomething(); } }catch(e){ console.log('responde[0].title is undefined'); }