构造函数返回对创建原型的字符串函数的引用。
string.constructor
返回创建此对象的函数。
<html> <head> <title>JavaScript String constructor Method</title> </head> <body> <script type="text/javascript"> var str=new String( "This is string" ); document.write("str.constructor is:" + str.constructor); </script> </body> </html>
运行上面代码输出
链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/string-constructor.html
来源:LearnFk无涯教程网
str.constructor is: function String() { [native code] }
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)