Challenge 20 help please~~~~~


#1

Hi I have been looking up all the post for Challenge 20, this is at most I can come up with and still can get the right result:

function howDangerousValue(value) {
  if (value === "^") {
    return 100;
  } else if (value === "~") {
    return 50;
  } else {
    return 0;
  }
}

function safetyReport() {
  let myGrid = GRID.map(function(row) {
    return row.map(function(col) {
      return howDangerousValue(col);
    });
  })
  return myGrid;
}
safetyReport();

Result:
56%20PM

I appreciate anyone can help me with this :slight_smile:


#2

My code is extremely similar. I see small differences, but none of them look like errors.


#3

The problem has been solved, thank you for replying!! I accidentally put in two different versions of code. That was the error…
Waiting for the last challenge tomorrow :relaxed: