You probably already know this, but another way to write this:

```js
old_edge = adj[i] && adj[i].edges && adj[i].edges[j] ?
           adj[i].edges[j] :
           tile.edges[i];
```
or even just
```js
if (adj[i] && adj[i].edges && adj[i].edges[j]) {
  old_edge = adj[i].edges[j];
} else {
  old_edge = tile.edges[i];
}
```
Keeping boolean evaluation away a tiny bit farther away from assignment is cleaner IMO.