javascript中什么是函数:https://www.cnblogs.com/f6056/p/11758106.html
JavaScript中的函数是对象?:https://blog.csdn.net/weixin_38207472/article/details/90641322
关于JavaScript中函数的定义、对象以及对象实例化的理解:https://blog.csdn.net/lianglizhong1991/article/details/65935431
js 函数常见的三种实例化方式:https://www.cnblogs.com/szatpig/p/6888181.html

只有函数名后添加括号才能返回值。不然它是一个函数,没有执行,没有返回值

函数中包含着函数

var PolygonPrimitive = (function () { function _(positions) { this.options = { name: '多边形', polygon: { hierarchy: [], perPositionHeight: true, material: Cesium.Color.RED.withAlpha(0.4) } }; this.hierarchy = positions; this._init(); } return _;//返回的对象,其实是一个构造函数? });
对比bb和PolygonPrimitive

浙公网安备 33010602011771号