<script>
var HHH6 = typeof(HST6) === 'undefined' ? {} : HHH6;
(function(){
HHH6.utils = {
mt:function mt(a) {
alert(a);//输出a
},
};
})();
// usage:
HHH6.utils.mt("000sss");
</script>
用ES6类的封装,上面的ES5的就显得low了。
<script>
class HUtils {
constructor(){
}
static log(a) {
console.log(a);
}
};
HUtils.log("mylog...");
</script>