JS构造函数
Posted 苹果园dog
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JS构造函数相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function LayerPoperty(cloudType,version,lineId,modelChunk) {
this.cloudType=cloudType;
this.version=version;
this.lineId=lineId;
this.modelChunk=modelChunk;
}
LayerPoperty.prototype.getVersion=function () {
return this.version;
}
var p=new LayerPoperty("wire",2017,435,‘1-200‘);
alert(p.getVersion());
</script>
</body>
</html>
以上是关于JS构造函数的主要内容,如果未能解决你的问题,请参考以下文章