Using a hash table, we're able to set each particular vertex as a hash key, and its value pairing to an array of adjacent vertices. We can use the default hash table data structure that comes with the language:

JAVASCRIPT
OUTPUT
Results will appear here.