javascript - Check if class constructor extends another class -


this question has answer here:

how can check if class constructor extends class, without constructing object? ie constructor reference.

example

class {  }  class b extends {  }  var b = b;  if(typeof b === b) 

you can check of instanceof below.

class {    }    class b extends {    }    class c {    }      console.log(b.prototype instanceof a);  console.log(c.prototype instanceof a);    // instance  var b = new b();    console.log(b instanceof b);  console.log(b instanceof a);  console.log(b instanceof c);


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -