Golden Mirage Level Help

Hi guys. It looks like I’m stumped in Golden Mirage as it seems like I can’t check if an item is not in an array in JavaScript:

// Collect 10 real coins.
var fakes = [];
var trues = [];
while (true) {
    var coins = hero.findItems();
    for (var i = 0; i < coins.length; ++i) {
        for (var j = 0; j < coins.length; ++j) {
            if (coins[j].value == coins[i].value) {
            } else {
        if (!coins[i] in fakes) {
    var coin = hero.findNearest(trues);
    if (coin) {

and this block:

if (!coins[i] in fakes) {

throws up this error:

Thanks for any help!

I’m not very familiar with javascript, but the ! that they are telling you about, why did you put it?
(I’m asking because I don’t know much javascript :see_no_evil: )

A ‘!’ is a ‘not’ in Javascript.


Try wrapping it in parentheses. And if that doesn’t work, put fakes.indexOf(coins[i]) == -1

It works with parentheses in my level.

I tried that but it didn’t work

Because Golden Mirage is broken