(currCourse, graph, path)
| 39 | }; |
| 40 | |
| 41 | var isCyclic = (currCourse, graph, path) => { |
| 42 | const hasSeen = path[currCourse]; |
| 43 | if (hasSeen) return true; |
| 44 | |
| 45 | const isMissingNext = !(currCourse in graph); |
| 46 | if (isMissingNext) return false; |
| 47 | |
| 48 | return backTrack(currCourse, graph, path); |
| 49 | }; |
| 50 | |
| 51 | var backTrack = (currCourse, graph, path) => { |
| 52 | path[currCourse] = true; |