constructor属性用于对当前对象的构造函数的引用。可以用来判断对象的类型:
<script> var newStr = new String("One world One Dream"); if( newStr.constructor == String){ alert("这是一个字符串对象"); } </script>
JS中constructor属性
原文:https://www.cnblogs.com/xiaohaodeboke/p/12180369.html