I'm a little confused about the licensing. In the LICENSE file it says that the repository is under MIT license. But in the header of some js files there is a copyright notice with apache-2.0. Does this copyright notice affect the licensing? What is the copyright notice in the file header?
A "license" simply means legal permission to do something from a rightsholder. The relevant question is: if the rightsholder sued you for exercising some right (e.g., copying or modifying their copyrighted work), could you prove to a court's satisfaction that you actually had permission to do that? The mismatch between licensing statements makes me uncomfortable saying what a court might decide about what rights had been licensed to you.
Furthermore, this mismatch makes me strongly suspects some Apache 2 files have been taken from another upstream program by this downstream developer, who has licensed their new work under MIT, possibly without satisfying their attribution/license-preservation requirements. I would certainly investigate if the Apache 2 labeled files have been taken from another project. This is generally allowed by the Apache 2 license, but requires keeping copyright notices and the Apache 2 license text, which I can't be sure has happened here. I would hold off on using this code until I identified the original author of each file, verified how they licensed the file, and ensured that my use complied with the requirements of each of those licenses.
In an ideal world each project would have a homogeneous license for all its files, and components from other projects (and under other licenses) would be in dependencies or the like. But life is what happens while we make other plans.
In the real world we see some projects, which have files copied in from other projects, and which have other licenses. As an example I often use org.springframework.security:spring-security-crypto , it clearly seems to be an Apache 2.0 licensed library. However it includes one file which is under ISC license: BCrypt.java . This fact is not declared anywhere except within that specific file.
Situations like this are difficult to avoid for those using the software, for the development team of the library it would be easy to include the information in their LICENSE or NOTICE file. On the other hand, if the license declaration, the license language and the attribution notices are all included in that file they are likely complying with the legal requirements. Hopefully someone has checked if the different licenses are compatible.
As this is sometimes unavoidable, your question rightly focuses on how to deal with it. The answer is simple: You should respect the license and comply with its requirements. Where there is a specific license declaration in a file it overrides the license declaration of the entire project (which has been made for all files without such individual declaration).
As @apsillers has stated in his answer, if you are unclear where the code comes from, or if you are unclear about the compatibility of the licenses, you should hold off using the code until you are certain that your questions have been satisfactorily answered.