mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Corrected let to const
This commit is contained in:
@ -17,7 +17,7 @@ class Graph {
|
||||
nodeNeighbors (node) {
|
||||
// Returns an array with all of the node neighbors
|
||||
const neighbors = new Set()
|
||||
for (let edge of this.edges) {
|
||||
for (const edge of this.edges) {
|
||||
// Checks if they have an edge between them and if the neighbor is not
|
||||
// already in the neighbors array
|
||||
if (edge.node1 === node && !(neighbors.has(edge.node2))) {
|
||||
|
Reference in New Issue
Block a user