The value to be checked.
true if the value is an ES6 class constructor, otherwise false.
This function uses Function.prototype.toString() to check if the
value is a class constructor but it is unstable for native constructors.
| Value | Result (Typical) |
|---|---|
class {} |
true |
class A extends B {} |
true |
function () {} |
false |
function () {}.bind() |
false |
() => {} |
false |
{} |
false |
URL |
runtime-dependent |
Determines whether the provided value is an ES6 class constructor.
Note:
Native constructors (
URL,Map, etc.) are runtime-dependent and may yield different results across environments.This behavior is due to engine implementation differences and cannot be fully normalized without sacrificing correctness.