I have a problem with an equal statement in Javascript. Look at this screenshot:

I am trying to check whether index is the same as “Delete”, but it is never true. It also is not true if I try index === "Delete" or index == "Delete".
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
indexis an Object, which does not appear to have atoString()method. Therefore callingtoString()in it will most likely result in[object Object], which is obviously not what you’re after.Try
if( index.return === "Delete")instead.