Working with Graphs & Trees

What could improve the efficiency of this shortest path implementation?
function dijkstra(graph, start) {
  const distances = {};
  const previous = {};
  const nodes = new Set();
  
  for (let vertex in graph) {
    distances[vertex] = vertex === start ? 0 : Infinity;
    nodes.add(vertex);
  }
  
  while (nodes.size) {
    const closest = Array.from(nodes).reduce((min, node) => 
      distances[node] < distances[min] ? node : min
    );
    
    nodes.delete(closest);
    
    for (let neighbor in graph[closest]) {
      const newDistance = distances[closest] + graph[closest][neighbor];
      if (newDistance < distances[neighbor]) {
        distances[neighbor] = newDistance;
        previous[neighbor] = closest;
      }
    }
  }
  
  return { distances, previous };
}
Next Question (16/21)