【发布时间】:2015-05-13 01:10:16
【问题描述】:
在使用显示模块模式时,函数和属性的正确起始案例是什么?我在这里用小写表示函数,用大写表示属性,但感觉不正确。
return {
getRecords: getRecords, // this is a function
CurrentTitle: getCurrentRecord().title // this is a title
};
【问题讨论】:
-
无论您使用何种模式创建它们,普通的方法和属性总是小写的。仅对构造函数使用大写名称,并且可能用于模块标识符。
标签: javascript revealing-module-pattern