简单教程
提交运行
代码编辑器:
<p>范例中, myFunction 是函数构造函数</p> <script> function myFunction(arg1, arg2) { this.firstName = arg1; this.lastName = arg2; } var x = new myFunction("John","Doe") document.write(x.firstName); </script>
运行结果: