Javascript startsWith() help

Javascript startsWith() help

This code is not working. I don't know much about Javascript but I am trying. The startsWith() function is what I added to the code and it killed everything. What am I doing wrong here?
  1. var idToShow = location.pathname.split("/")[1];

  2. if (idToShow == "index") {
  3. $("#home").show();
  4. }
  5. else if (idToShow.startsWith("_webapp")) {
  6. $("#district").show();
  7. }
There is obviously more to this but hopefully you will be able to see what is wrong here.
When ran it completely kills my code.

Thanks!
Austin