NOTE: Not every possible scenario is provided in this example. You are encouraged to further modify this code to suit your needs For example, courses can be added to both schools and departments, but ...
It's not terribly clean, but you could use indexOf() and check if it returns -1. Better than breaking out a loop.