3 ms·
Java deals with almost exactly the same issue. If you define an interface and a single implementing class, the code will be compiled to always call that classes
by tomp 7y ago
Java deals with almost exactly the same issue. If you define an interface and a single implementing class, the code will be compiled to always call that classes method, and the deoptimized / recompiled if you load another class that implements that interface. JS could deal with these issues in a similar manner.