JavaScript Tarjan's Algorithm
javascript\nvar criticalConnections = function(n, connections) {\n    const adjList = {};\n    for (let [x,y] of connections) {\n        if (adjList[x]) adjList
```javascript\nvar criticalConnections = function(n, connections) {\n    const adjList = {};\n    for (let [x,y] of connections) {\n        if (adjList[x]) adjList[x].push(y);\n        else adjList[x] = [y];\n        if (adjList[y]) adjList[y].push(x);\n        else adjList[y] = [x];\n    }\n    const criticalEdges = [];\n    const times = {};\n    let time = 0;\n    const dfs = (vertex, parent) => {\n        if (times[vertex] !== undefined) return times[vertex];\n        const val = times[vertex] = time++;\n        for (let toVertex of adjList[vertex]) {\n            if (toVertex === parent) continue;\n            const next = dfs(toVertex, vertex);\n            if (val < next) criticalEdges.push([vertex, toVertex]);\n            times[vertex] = Math.min(next, times[vertex]);\n        }\n        return times[vertex];\n    }\n    dfs(0,null);\n    return criticalEdges;\n};\n```
['JavaScript']