Closed EvanCarroll closed 6 years ago
However, I don't see any of the edges lacking a - or having satisfying graph[from] == null
That's not what that tests. Try removing it and see it break. It handles the first time a node name is found, at which point it doesn't have an array of neighboring nodes yet.
I also think this is awkward syntax
'Awkward' is mostly a matter of what you're used to. I definitely prefer this form to the two you proposed.
The roads don't become edges until you extract directionality out of them,
The function works for any graph, so at this point edges is an appropriate word.
In CH7, you have
However, I don't see any of the edges lacking a
-
or having satisfyinggraph[from] == null
. Perhaps that condition can be yanked. I also think this is awkward syntaxI think that is better written as,
Or, if you want to be more clever than that you can follow it through with a more traditional functional pipeline
All of these are more idiomatic js.
This chapter could definitely use some disambiguation too on the names.
For example
Should really be
The roads don't become edges until you extract directionality out of them,
Would be far better for explaining.