An implementation of an adjacency graph in JavaScript