In a javascript i am storing an array of values. My question I want to compare each and every index value. When I am using && I am getting error saying

enter image description here

The string message in alert

var result =<value>;
if(result["compiled"] !=  "false") && (result["success"] != "false"))
  alert("Please check you Debug log for the error");

1 Answer 1


You are missing a parentheses at the start of your if condition.

if(result["compiled"] != "false") && (result["success"] != "false"))

Should be:

if((result["compiled"] != "false") && (result["success"] != "false"))

Or you can omit some brackets:

if(result["compiled"] != "false" && result["success"] != "false")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .