So far my code reads:

function howDangerous(coordinate) {if (isRock(coordinate)) return 100;

else if (isCurrent(coordinate)) return 50;

else {return 0;}

}

Can anyone provide input as to what I’m doing wrong?

TIA

So far my code reads:

function howDangerous(coordinate) {if (isRock(coordinate)) return 100;

else if (isCurrent(coordinate)) return 50;

else {return 0;}

}

Can anyone provide input as to what I’m doing wrong?

TIA

Let me try and parse your code for you here…

```
function howDangerous(coordinate) {
if (isRock(coordinate)) return 100;
else if (isCurrent(coordinate)) return 50;
else {
return 0;
}
}
```

As a note, 4 spaces and then your code will do the above pre-formatting so it is more readable!

Upon first inspection, your code looks fine. I also tested it with my isRock and isCurrent functions and it seems to work correctly. What is the error message that you are getting?

@karcar you could do this instead:

```
function howDangerous(coordinate) {
if (isRock(coordinate)) return 100;
if (isCurrent(coordinate)) return 50;
return 0;
}
```

Hmm… that isn’t working either… I’m beginning to think I have something incorrect with isRock() or isCurrent()

I have seen a few threads reference a broken lightcell() or isRock() etc after the challenge where we had to go back and implement a check for proper input. I would suggest looking back through all relevant functions which your new function utilizes.

Thank you! It was the updated lightCell() function that was causing the error. Once I corrected for the updated version, I was able to solve the challenge!