How to prefer one enemy over another if preferred is around?

Interesting. I’ve tested the code, and it seems to work fine for me. I dunno.

Wrap you code with triple backticks (```) as shown here, for the pretty code formatting.

And for the “Unexpected Identifier”, the jshint asi:true should’ve been a comment. Should have made it more clear. (Though I guess you fixed it on your own.)