You can use the javascript idiom for if-statements, for example:
if (d.failed) { // code in here will execute if not undefined or null }
Just. In your case, it should be:
if (d.failed && d.failed != 'true') { myPush(); }
Ironically, it reads "if d.failed exists and has the value" true ", as OP wrote in the question.
source share