Advertisement
Venciity

Abstract class JavaScript

Nov 7th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Animal = function() {
  2.     if (this.constructor === Animal) {
  3.       throw new Error("Can't instantiate abstract class!");
  4.     }
  5.     // Animal initialization...
  6. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement