Using the same analogy, when you hire a JavaScript developer they are going to know a ton about JS itself, but nothing about your internal libraries and system, and that's something they are going to catch up on when they can, and for a large enough system, they are going to probably gain domain knowledge in a specific portion of your code base. However, they will know how to make an array, class, subroutine, etc. (I'm not proficient in JS right now, and would probably have to look all this up - in perl I can do it without thought).
Similarly, my doctor _should_ know how human anatomy and microbiology work by default, but the person that they are speaking to is essentially a black box. When that black box is diseased, then it's as if the body has imported a library. They cannot easily check the source code to determine which library they have imported or what calls it is making, so they hunt through a bug database to determine which library they have imported and what the code is doing, and then they have to find a way to get that code out of the system, still without access to the source. Of course, they will probably know some things (sinus infection, flu) by default, but medical science is constantly updated. Still, that knowledge of anatomy, microbiology, etc., is tantamount in being able to accurately use that data for assessment.
Similarly, my doctor _should_ know how human anatomy and microbiology work by default, but the person that they are speaking to is essentially a black box. When that black box is diseased, then it's as if the body has imported a library. They cannot easily check the source code to determine which library they have imported or what calls it is making, so they hunt through a bug database to determine which library they have imported and what the code is doing, and then they have to find a way to get that code out of the system, still without access to the source. Of course, they will probably know some things (sinus infection, flu) by default, but medical science is constantly updated. Still, that knowledge of anatomy, microbiology, etc., is tantamount in being able to accurately use that data for assessment.