Vertex cover approximation in JavaScript
As you can see after adding edges to the graph, G[v] has the list of neighbours of v, correct?
Therefore the length of G[v] for the vertex v is equal to the number of edges joining v.
Notice that each edge u-v appears twice in G, once in the neighborhood set of u, and once in the neighborhood of v (G[u] contains v and G[v] contains u both referring to the single edge u-v).
So these being said let's have a look at the code.

We iterate over all vertices in the outermost for loop;
for each vertex v in the set of vertices, we iterate over all edges connected to it.

Since each edge has appeared twice in the list (as mentioned above), we are basically counting (or visiting) each edge twice using these two nested loops.
Hence, the complexity of these two for loops could be O(E) where E is the number of edges in the graph.

Notice that the outer loop, iterates through all vertices any way. So, the complexity of the runtime cannot be less than O(V). This being said the complexity of the algorithm is the maximum of O(E) and O(V), which is exactly what O(V+E) means.