function F() { function f1() { console.log('f1') } function f2() { console.log('f2') } function f3() { console.log('f3') } // 暴露API return { f1: f1, f3: f3 } } var f = new F() f.f1() f.f3()
function F() { function f1() { console.log('f1') } function f2() { console.log('f2') } function f3() { console.log('f3') } // 暴露API return { f1: f1, f3: f3 } } var f = new F() f.f1() f.f3()